in reply to Re: Shortcutting grep in boolean context
in thread Shortcutting grep in boolean context
Ah yes, this is a nice idiom, and to use it in an expression, one can use e.g. do:
if (do { my $found; $_ == $wanted and $found = 1 and last for @ary; $found }) { say "match" }'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Shortcutting grep in boolean context
by tybalt89 (Monsignor) on Jan 03, 2017 at 22:28 UTC | |
by perlancar (Hermit) on Jan 04, 2017 at 01:07 UTC |