in reply to Idiom for setting variables to empty string if capture is undefined?

use strict; use warnings; $_='a'; my( $a, $b, $c ) = map defined $_ ? $_ : '' , m/(.?)(.?)(.?)/; print "'$a''$b''$c'\n"; __END__ 'a'''''
  • Comment on Re: Idiom for setting variables to empty string if capture is undefined? (map defined $_ ? $_ : '' , m//
  • Download Code