Help for this page
use strict; use warnings; ... $str =~ s/^R(?:([12])|(3))?$/${1}text$2/; $str; }
sub munge { my $str = shift; ... {(defined $1 ? $1 : '') . 'text' . (defined $2 ? $2 : '') +}e; $str; }