Update: a typo and factual error. Mis-read my own benchmark.
As (was:if) you know your files are not too big to fit in memory and you really need the speed, the add this to your benchmark. It beats your code by 400%60%. Standard perl.
sub sub3 { open FILE, 'yourfile' or die $!; binmode FILE; my @lines = split $/, do{ local $/; <FILE>; }; close FILE or warn $!; }
In reply to Re: Re: Re: Why use <$fh> at all?
by BrowserUk
in thread Why use <$fh> at all?
by cluka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |