Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

4.7. Editing files

In the examples thus far, you’ve seen how to read data from a file, make modifications, and send the results to the output. But it’s often desirable to have the modifications appear in the original file itself, rather than in an output stream flowing to the screen or to a different file. Accordingly, you’ll learn how to do in-place editing with Perl next.

4.7.1. Editing with commands

Sometimes, companies behave strangely. And when they do, they usually say, “The lawyers made us do it!” Imagine, if you will, that one day at work while you’re minding your own business, the following message appears in your email:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint