Everything You Ever Wanted to Know About THAT File

To find out, in excruciating detail, everything you might want to know about a file, you can use Perl's stat function. The stat function originated in Unix, and the return values differ slightly between Unix and non-Unix systems. The syntax for stat is as follows:

stat filehandle;
stat filename;

The stat function can retrieve information either about an open filehandle or about a particular file. Under any operating system, stat returns a 13-element list describing the attributes of the file. The actual values in the list differ slightly depending on which operating system you're running because some operating systems include features that others do not implement. Table 10.3 shows what each ...

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.