use strict; use warnings; $_='a'; my( $a, $b, $c ) = map defined $_ ? $_ : '' , m/(.?)(.?)(.?)/; print "'$a''$b''$c'\n"; __END__ 'a'''''
In reply to Re: Idiom for setting variables to empty string if capture is undefined? (map defined $_ ? $_ : '' , m//
by Anonymous Monk
in thread Idiom for setting variables to empty string if capture is undefined?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |