laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello IB2017,
you are looking for wisdom, not for elegance! ;=) Elegance can be your enemy: better looking for efficiency and readability. You already received a wise answer by Eily++ about grep If your do_something is short as print you can consider also the unless postscript form:
It's an handy and readable syntax. If the loop is complex and actions are more, something very similar to your example is a wise form to express some logic: a good principle exit loop early
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS. In reply to Re: loop array excluding some elements
by Discipulus
|
|