Re: help slurping a file
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Fri, 28 Oct 2005 03:53:07 -0700
Renee Halbrook wrote:
> Hi,
Hello,
> I'm not sure if this is the correct group to post this question to. If there
> is a better forum for this kind of question, please let me know.
>
> I am trying to slurp a file that was written on Mac OSX, using a standard
> text editor.
> I am developing on a windows machine, and running my scripts on a Linux box.
> I get the same problem on both machines.
>
> If I set the local($\ = "\r")
> I can get a line by line read of the file.
> However, if I set the
> local($\=undef)
> or
> local($\="")
$\ is the *OUTPUT RECORD SEPARATOR* so it will have no effect on how files are
read in.
> The script will only read in the first line of the file, and then quit.
> I got a read of the byte code in java, and the endline character is indeed
> "\r".
> My question is, why can't I slurp in the entire file?
perldoc -q "How can I read in an entire file all at once"
John
--
use Perl;
program
fulfillment
.
- Follow-Ups:
- Re: help slurping a file-- Solved -- Thanks for responses
- From: Renee Halbrook
- Re: help slurping a file-- Solved -- Thanks for responses
- References:
- help slurping a file
- From: Renee Halbrook
- help slurping a file
- Prev by Date: Re: about running unix command in perl script
- Next by Date: RE: about running unix command in perl script
- Previous by thread: help slurping a file
- Next by thread: Re: help slurping a file-- Solved -- Thanks for responses
- Index(es):
Relevant Pages
|