in reply to Re: Grepping with Perl: How to stop after first match?
in thread Grepping with Perl: How to stop after first match?
"first" ... does exactly what you want
"Exactly" is a strong word. If he's trying to avoid reading through the whole file he won't achive that by using first. To some, first may seem to lazily evaluate its list arguments, but I'd like to emphasize that this is not the case. first will cause the whole file to be slurped into memory.
lodin
Update: changed "list" to "argument" to be more technically (?) correct.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Grepping with Perl: How to stop after first match?
by dragonchild (Archbishop) on Dec 06, 2007 at 01:49 UTC |