in reply to Re^5: Ways to control a map() operation
in thread Ways to control a map() operation
You're playing on words now. The original point is you cannot leave an eval with last. Otherwise this should work:
for (1..100) { eval { if ($_ % 2 == 0) { last; } print $_, "\n"; }; }
and expect it to print only odd numbers.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Ways to control a map() operation
by betterworld (Curate) on Jul 16, 2006 at 14:57 UTC | |
by Leviathan (Scribe) on Jul 16, 2006 at 16:12 UTC |