Addison-Wesley converted our chapter on “Files and Filehandles” to HTML and put it online for as a free sample chapter. I selected this chapter as the free sample because it was the most fun to write but also the most valuable to new Perl programmers. Filehandles are the way you interact with the world, and using them wisely can give your program quite a bit of flexibility and make many tasks much easier.
Here’s the list of Items from that chapter, each of which you can read for free online:
- Item 51. Don’t ignore the file test operators.
- Item 52. Always use the three-argument open.
- Item 53. Consider different ways of reading from a stream.
- Item 54. Open filehandles to and from strings.
- Item 55. Make flexible output.
- Item 56. Use File::Spec or Path::Class to work with paths
- Item 57. Leave most of the data on disk to save memory.
We’ve also added more Items for “Files and Filehandles” in this blog, which you can also read for free. However, don’t forget about that Donate button on the right had side of the page if you find this site valuable. Or, buy our book and encourage all your friends to buy our book. Donations and book sales give us a little motivational boost to keep going. :)