"Perl for Perl Newbies" - Part 4More System FunctionsThe stat() Function

7.5. The stat() Function

The statfunction can be used to retrieve a 13-element array that gives status information for a given file or filehandle.

The syntax is:

        = stat($filename);

Here, $modeis the file mode, $sizeis the size of the file, $atimeis the last access time (in seconds since the epoch), $mtimeis the last modification time.

For more information about statconsult perldoc -f stator its entry in perlfunc.

Written by Shlomi Fish