File::stat#

Native implementation of File::stat

Provides by-name interface to Perl’s stat() builtin. Returns blessed objects with accessor methods for stat fields.

Functions#

stat#

Returns a blessed File::stat object (arrayref) for a path or filehandle. Follows symlinks.

use File::stat;
my $st = stat('/etc/passwd');
print $st->size, "\n";

lstat#

Like stat, but does not follow symlinks (uses symlink_metadata).

use File::stat;
my $st = lstat('/path/to/symlink');
print $st->mode, "\n";