go ahead... be a heretic | |
PerlMonks |
Re: "return" to break out of a loopby 5mi11er (Deacon) |
on May 13, 2008 at 14:40 UTC ( [id://686279]=note: print w/replies, xml ) | Need Help?? |
Yes, you're being overly fussy. This type of construct is very common because it is both clear and more efficient than say setting a "truth flag" then having to finish examining the rest of the values. The other way to write this and to keep efficiency is something like: Which is about twice as long. So, I personally like the 4 line version better. -Scott Update: I like anonymous monk's one line grep version above even more :-)
In Section
Seekers of Perl Wisdom
|
|