$ perl -le '$1=undef;' Modification of a read-only value attempted at -e line 1. #### "1234"=~/(\d)/; print "$1\n"; "1234"=~/34/; print "$1\n"; print "undef\n" if ! defined $1; #### 1 undef #### "1234"=~/(x)?34/; print "undef" if ! defined $1;
## "1234"=~/(\d)/; print "$1\n"; "1234"=~/34/; print "$1\n"; print "undef\n" if ! defined $1; ##
## 1 undef ##
## "1234"=~/(x)?34/; print "undef" if ! defined $1;