perl -pi -e 's/change this/into this/g' filename(s)
-p assumes an input loop around your script. Lines are printed.
-i in-place editing of files
-e may be used to enter a single line of script. Multiple -e commands may be given to build up a multiline script.
Combined with "find" with -exec and/or pipe the filenames into xargs and you can do a global search and replace across a whole tree of files.
Also I recommend adding a backup for inplace edits.
man perlrun recommends -spi.orig
perl -pi -e 's/change this/into this/g' filename(s)
-p assumes an input loop around your script. Lines are printed.
-i in-place editing of files
-e may be used to enter a single line of script. Multiple -e commands may be given to build up a multiline script.
Combined with "find" with -exec and/or pipe the filenames into xargs and you can do a global search and replace across a whole tree of files.