use strict; my $orig="the fixed string replacement"; my @words=qw(the fixed string replacement); foreach my $word (@words) { my $index=index($orig, $word); if ($index >-1) { substr($orig, $index, length($word))=$word . $word; } } print $orig;