in reply to How can you sysread an entire file?
If you really want to put it all in an array at once, use this: @array = split /(?<=\r)/, $rec; If you don't have a compelling need to do that, though, then I would recommend processing it line by line:
while ($rec =~ /([^\r]+\r?)/g) { frobulate($1); }
Both of the above assume that you mean a carriage return, not a newline, when you say carriage return (and that you're not running this on a machine running Mac OS 9 or lower).
If God had meant us to fly, he would *never* have given us the railroads.
--Michael Flanders
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How can you sysread an entire file?
by NeilF (Sexton) on Jan 13, 2006 at 23:15 UTC | |
by ChemBoy (Priest) on Jan 14, 2006 at 07:35 UTC | |
by NeilF (Sexton) on Jan 14, 2006 at 17:22 UTC | |
by BrowserUk (Patriarch) on Jan 14, 2006 at 17:56 UTC | |
by NeilF (Sexton) on Jan 14, 2006 at 19:54 UTC |
In Section
Seekers of Perl Wisdom