Is it possible to pass a block of code to a sub using parenthesis syntax?
those. when I write
List::MoreUtils::any { defined ($_) } (undef, undef, 1);
it works. But when I try to add parentheses
List::MoreUtils::any ( { defined ($_) } , (undef, undef, 1) );
this is interpreted as an anonymous error message hash. Neither acceleration nor the use of eval helps.
The idea of all the fuss is that the challenge is part of the expression, i.e.
if (first_index { defined (${$_})} $jms_positions > $jms_positionals_seen )
some operator following the arguments may be executed before the call, creating an undesirable result.
source
share