How do I get a file's last modified time in Perl?

后端 未结 9 887
说谎
说谎 2020-12-13 03:36

Suppose I have a filehandle $fh. I can check its existence with -e $fh or its file size with -s $fh or a slew of additional informati

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 04:01

    Use the builtin stat function. Or more specifically:

    my $modtime = (stat($fh))[9]
    

提交回复
热议问题