|
|
| P is for Practical | |
| PerlMonks |
Re^4: do $n exist in grep?by choroba (Cardinal) |
| on May 12, 2021 at 17:02 UTC ( [id://11132505]=note: print w/replies, xml ) | Need Help?? |
|
It's also possible to shorten the lines with
but only if the left hand side of x doesn't have any side-effects (because unlike the ternary operator, foo() x 0 still calls foo). See also PerlX::Maybe.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||