in reply to Re^2: Shortcutting grep in boolean context
in thread Shortcutting grep in boolean context
To avoid a temporary variable:
if( sub{ $_ == $wanted and return 1 for @ary; 0 }->() ) { say "match" +}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Shortcutting grep in boolean context
by perlancar (Hermit) on Jan 04, 2017 at 01:07 UTC |