use strict; use warnings; my $msg = 'this is a test'; my $pat = ''; my $rep = ''; $msg =~ s/$pat/$rep/; print $msg, "\n";