my $pre = '\xe9'; my $post = '\x65'; my $re = qr/s\/$pre\/$post\/g/; my $path = 'C:\Scripts\Working2'; my $fileSep = "\\"; my $file = 'Users_0.xml'; my $tempFile = 'C:\Scripts\Working2\Users2.xml'; if (!open(IF, "<$path$fileSep$file")) { die("Could not open file $path$fileSep$file $!"); } if (!open(OF, ">$tempFile")) { die("Could not open file $tempFile $!"); } while($str = ) { $str =~ $re; print OF $str; } close IF; close OF;