$ perl -Mwarnings -le' $_ = "x"; s/(x)/ my $str = $1; print "$1"; $str =~ s<>; print "$1"; /e; ' x Use of uninitialized value in string at -e line 1.