my $target = 'this is a test of the servise'; for my $is ($target =~ /is/) { $target =~ s//are/; } print "$target\n"; # yields "thare are a test of the servaree'