P is for Practical | |
PerlMonks |
Re^2: "return" to break out of a loopby mscharrer (Hermit) |
on May 13, 2008 at 14:56 UTC ( [id://686286]=note: print w/replies, xml ) | Need Help?? |
Very short but not very efficient because the implicit loop is not aborted at the first successful match. Because grep is returning the number of successful matches in scalar context all list elements are getting checked. More efficient would be:
In Section
Seekers of Perl Wisdom
|
|