my ($from, $to) = (shift, shift); @ARGV == 1 or die "Usage: $0 from_string to_string filename\n"; while (<>) { s/\Q$from/$to/g; print; }