use Tie::RegexpHash; my %sr; tie %sr, 'Tie::RegexpHash'; # - - - - - - - - - - - - - - - - - - - - - - - - - - # search and replace $sr{qr/\b(h)arbour\b/i} = '$2arbor'; $sr{qr/\b(h)onour(.*?)\b/i} = '$3onor$4'; $sr{qr/\b(c)entre\b/i} = '$5enter'; # - - - - - - - - - - - - - - - - -- - - - -- - - - - $_ = "Programmers Honoured at Harbour Centre\n"; print; my $s = join("|", keys%sr); s/($s)/eval'"'.$sr{$1}.'"'/ge; print; __END__ Programmers Honoured at Harbour Centre Programmers Honored at Harbor Center