I'm pretty sure that () = <$fh> loads the entire file contents into memory at once (on the stack), not throwing any of it away until the entire file has been read. So you might as well just use:
my $count= ()= <$fh>;
If you want to avoid memory use:
my $count= do { 0 while <$fh>; $. };
- tye
In reply to Re^3: No plan "weakens" my Test scripts? (slurps)
by tye
in thread No plan "weakens" my Test scripts?
by thor
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |