from the command line, substitute in-place while backing up the files to *.old

% perl -pi.old -e 's/pattern/subs/g' FILES

or use the following script:

#!/usr/local/bin/perl -pi.old

while(<>) {
	s/\bpattern\b//g;
}