in reply to what's this loo code?
I waited and two explanations have already appeared as I hoped and expected...
But I wanted to mention my first impression when I saw that code in jmcnamara's node: "Oh, that takes way too much memory and will fail for files that don't fit within your available swap space".
The number of possible Perl one-liners that print a line count and don't suffer from requiring way too much memory for large files is quite huge. I'll shoot for a very straight-forward one: perl -le '1 while <>; print $.' file I'm almost certain you can make that faster or shorter (without reintroducing the memory hog aspect of it), but I really don't care to do either.
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: what's this loo code? (*slurp*)
by Kanji (Parson) on Feb 04, 2003 at 18:51 UTC | |
Re: Re: what's this loo code? (*slurp*)
by jmcnamara (Monsignor) on Feb 04, 2003 at 23:58 UTC | |
Re^2: what's this loo code? (*slurp*)
by Aristotle (Chancellor) on Feb 04, 2003 at 23:40 UTC | |
by John M. Dlugosz (Monsignor) on Feb 05, 2003 at 03:58 UTC | |
by Aristotle (Chancellor) on Feb 05, 2003 at 08:01 UTC | |
Re: Re: what's this loo code? (*slurp*)
by John M. Dlugosz (Monsignor) on Feb 05, 2003 at 03:52 UTC | |
by pfaut (Priest) on Feb 05, 2003 at 04:11 UTC |
In Section
Seekers of Perl Wisdom