While going through the examples you might check the meaning of the run time options, too. It should be in the manual page "perlrun"
The -n and -p are very useful as they wrap loops around your one-liner. The -i does in-place editing so this one-liner replaces the word "foo" if it is a whole word with the word "bar" through out all files with names ending in .txt The original, untouched files will end in .txt.old
Code:
perl -pi.old -e 's/\bfoo\b/bar/g' *.txt
It was a recipe something like that which piqued my interest in perl originally.