in reply to Re^3: [Class Assignment] Regex and Output Files
in thread [Class Assignment] Regex and Output Files

Digital transcripts regarding the plight of a certain hammer wielding Aasgardian in this matter are also deemed of historical interest.

A substitution of a word in a file can be conducted from the command line. Optional backup can be output with a suffix of your choosing, placed after the -i flag.

Easy as

%> perl -pi -e "s/\bnew\b/old/ig;" .\newfile.txt

for a backup copy, place in a preheated oven

%> perl -pi.bak -e "s/\bnew\b/old/ig;" .\newfile.txt