in reply to Re^2: No plan "weakens" my Test scripts?
in thread No plan "weakens" my Test scripts?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: No plan "weakens" my Test scripts? (slurps)
by xdg (Monsignor) on Feb 22, 2005 at 02:09 UTC |