perl -ne 's/foo/bar/ if /baz/ && /yot/; print "Line number $. changed to $_"' file1
And do some awk-ish line splitting:
perl -F, -ane '$sum += $F[2]; END{ print "The sum of column 3 is $sum" }' file1
It absolutely flies in the face of the unix philosophy and is much more complicated than picking up each tool individually, but once you get to grips with 'em they're very handy.
This blew my mind recently, when I had to delete millions of files in a directory and rm didn't make the cut (too many arguments), and find -delete took forever:
This definitely interests me. How does perl surpass Unix tools? I guess perl has the benefit of handling the equivalent of sed and awk.