Free Files, Testing Files, and Binary Data

Files and file systems don't contain just the data that you put into files. On the one hand, filehandles sometimes represent more than a simple file. They may stand for such things as the keyboard, the monitor screen, network sockets, or mass storage devices such as tape drives.

Also, in addition to the data stored in the files, a file system contains what's called metadata—that is, data about the data in its files. Perl can be used to get metadata out of the file system; for example, to determine how big your file is, when it was last changed, who changed it, and information about what's in the file. With some operating systems, the file metadata can even determine whether the file is treated as a text ...

Get SAMS Teach Yourself Perl in 24 Hours THIRD EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.