Skip to main content

Blog Archive for tomwhite during April 2005

Perl is famous for its one-liners. By using the -e command line switch you can execute the script supplied as an argument. But the real power comes when you use -p (to process each line of a supplied file), and -i (to modify the file in place). The classic example is to perform search and replace on a bunch of files. The following will replace all occurrences of curious george with the gruffalo...