Using Perl to Replace or Delete Strings
Perl is a complete programming language that runs under both UNIX and Windows. Although it usually does not come packaged with any commercial UNIX distribution, it is readily available via the Internet for most UNIX systems. If Perl is available on your system, you can also use it as a simple command-line utility that provides replacement capabilities not available in sed.
sed 's/Mr. Smith/Ms. Wilson/g' report7 perl -pe 's/Mr. Smith/Ms. Wilson/g' report7
Earlier, this chapter discussed the g flag for sed. It means the same thing to perl: process all patterns on the line, not just ...