use File::stat ":FIELDS"; ... stat($fh) or die $!; my ($atime, $mtime) = ($st_atime, $st_mtime); ...