> "R" == Ruud writes:
R> Thomas Bätzler wrote:
>> my $data = do {
>> local $/ = undef;
>> <$fh>;
>> };
R> Especially for big files, that is better written as:
define big. most files are still text or similar and not big by today's
ram sizes. slurping in a megabyte is nothing to
Thomas Bätzler wrote:
my $data = do {
local $/ = undef;
<$fh>;
};
Especially for big files, that is better written as:
my $data;
{ local $/;
$data = <$fh>;
}
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http
Doug Cacialli asked:
> Does anyone have any ideas how I can make the second block of code
> work? Or otherwise accomplish the task without opening the .txt file
> twice?
How large are your data files? If your available memory is much larger than
your maximum file size, you might get away with s