Perl: the Markov chain saw | |
PerlMonks |
Re^2: Shortcutting grep in boolean contextby perlancar (Hermit) |
on Jan 03, 2017 at 21:31 UTC ( [id://1178877]=note: print w/replies, xml ) | Need Help?? |
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" }'
In Section
Seekers of Perl Wisdom
|
|