O'Reilly logo

Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition by brian d foy, Joshua A. McAdams, Joseph N. Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Files and Filehandles

It’s easy to work with files in Perl. Its heritage includes some of the most powerful utilities for processing data, so it has the tools it needs to examine the files that contain those data and to easily read the data and write them again.

Perl’s strength goes beyond mere files, though. You probably think of files as things on your disk with nice icons. However, Perl can apply its file-handle interface to almost anything. You can use the filehandle interface to do most of the heavy lifting for you. You can also store filehandles in scalar variables, and select which one you want to use later.

Item 51. Don’t ignore the file test operators

One of the more frequently heard questions from newly minted Perl programmers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required