in reply to Turning an argument into a regexp

Look at qr/STRING/ (perdoc perlop).

my $re = /\d+$/; # for an example pattern $thingy =~ /My Zip code is $re/; $thingy =~ /$re/; $thingy =~ s/foo{$re}bar/baz/; etc...

Cheers,
KM