programming-examples/perl/File/Pass file handle to stat function.pl

12 lines
240 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$filename = 'file.txt';
open FILEHANDLE, "<$filename";
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
$mtime, $ctime, $blksize, $blocks) = stat(FILEHANDLE);
print "$filename is $size bytes long.";