# version 1 ## problem, does not skip comments undef($/); my $text = ; foreach my $pat (keys %my_replacement) { $text =~ s/$pay/$my_replacement{$pat}/g; } print $text;