#!/usr/bin/perl { local ($^I, @ARGV) = ('.bak', shift ); while (<>) { $_ =~ s/M/N/gi; print "$_"; } } __END__