open (FIN, "$inputfile") || die("Cannot read the input file"); local $/; $string = ; close FIN; $string =~ s/find /replace/g; #and $string =~ s/find /replace/gs;