http://www.perlmonks.org?node_id=732916

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How do (can?) I read in a file and perform substitutions of this sort:
if ($_ =~ /^THIS/) {$_ =~ s/I/A/}
from the command line, rather than writing an actual script to open and rewrite the file.