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

7.5. The stat() Function

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

The syntax is:

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
    $atime,$mtime,$ctime,$blksize,$blocks)
        = stat($filename);

Here, $mode is the file mode, $size is the size of the file, $atime is the last access time (in seconds since the epoch), $mtime is the last modification time.

For more information about stat consult perldoc -f stat or its entry in perlfunc.


Written by Shlomi Fish