in reply to Re: File date
in thread File date

... function interface ... i got the same error as you

Using the mtime accessor/method, it seems to work just fine

$ perl -MPath::Tiny -le " print scalar gmtime( path( shift )->stat->mt +ime ) " . Mon Sep 14 09:38:52 2015 $ perl -MPath::Tiny -le " print scalar gmtime( path( shift )->stat->mt +ime ) " .. Fri May 29 06:13:23 2009 $ perl -MFile::stat -le " print scalar gmtime( stat( shift )->mtime ) +" . Mon Sep 14 09:38:52 2015 $ perl -MFile::stat -le " print scalar gmtime( stat( shift )->mtime ) +" .. Fri May 29 06:13:23 2009 $ perl -MPath::Tiny -le " print scalar gmtime( path( shift )->stat->mt +ime ) " NUL Error stat on 'NUL': Invalid argument at -e line 1. $ perl -MFile::stat -le " print scalar gmtime( stat( shift )->mtime ) +" NUL Can't call method "mtime" on an undefined value at -e line 1.

File::stat is from 2003 and is an Object Interface to builtin Perl's stat function.

File::stat is core, File::Stat is from 2003 and needs to be removed from CPAN :) maybe replaced with an independent non-core version of File::stat

Data for 2015-07-20 File::stat was first released with perl 5.004 5.004 undef 5.00405 undef 5.005 undef 5.00503 undef 5.00504 undef v5.6.0 undef v5.6.1 undef v5.6.2 undef v5.7.3 1.00 v5.8.0 1.00 v5.8.1 1.00 v5.8.2 1.00 v5.8.3 1.00 v5.8.4 1.00 v5.8.5 1.00 v5.8.6 1.00 v5.8.7 1.00 v5.8.8 1.00 v5.8.9 1.01 v5.9.0 1.00 v5.9.1 1.00 v5.9.2 1.00 v5.9.3 1.00 v5.9.4 1.00 v5.9.5 1.00 v5.10.0 1.00 v5.10.1 1.01 v5.11.0 1.02 v5.11.1 1.02 v5.11.2 1.02 v5.11.3 1.02 v5.11.4 1.02 v5.11.5 1.02 v5.12.0 1.02 v5.12.1 1.02 v5.12.2 1.02 v5.12.3 1.02 v5.12.4 1.02 v5.12.5 1.02 v5.13.0 1.02 v5.13.1 1.02 v5.13.2 1.02 v5.13.3 1.03 v5.13.4 1.03 v5.13.5 1.03 v5.13.6 1.03 v5.13.7 1.04 v5.13.8 1.04 v5.13.9 1.05 v5.13.10 1.05 v5.13.11 1.05 v5.14.0 1.05 v5.14.1 1.05 v5.14.2 1.05 v5.14.3 1.05 v5.14.4 1.05 v5.15.0 1.05 v5.15.1 1.05 v5.15.2 1.05 v5.15.3 1.05 v5.15.4 1.05 v5.15.5 1.05 v5.15.6 1.05 v5.15.7 1.05 v5.15.8 1.05 v5.15.9 1.05 v5.16.0 1.05 v5.16.1 1.05 v5.16.2 1.05 v5.16.3 1.05 v5.17.0 1.06 v5.17.1 1.06 v5.17.2 1.07 v5.17.3 1.07 v5.17.4 1.07 v5.17.5 1.07 v5.17.6 1.07 v5.17.7 1.07 v5.17.8 1.07 v5.17.9 1.07 v5.17.10 1.07 v5.17.11 1.07 v5.18.0 1.07 v5.18.1 1.07 v5.18.2 1.07 v5.18.3 1.07 v5.18.4 1.07 v5.19.0 1.07 v5.19.1 1.07 v5.19.2 1.07 v5.19.3 1.07 v5.19.4 1.07 v5.19.5 1.07 v5.19.6 1.07 v5.19.7 1.07 v5.19.8 1.07 v5.19.9 1.07 v5.19.10 1.07 v5.19.11 1.07 v5.20.0 1.07 v5.20.1 1.07 v5.20.2 1.07 v5.21.0 1.07 v5.21.1 1.07 v5.21.2 1.07 v5.21.3 1.07 v5.21.4 1.07 v5.21.5 1.07 v5.21.6 1.07 v5.21.7 1.07 v5.21.8 1.07 v5.21.9 1.07 v5.21.10 1.07 v5.21.11 1.07 v5.22.0 1.07 v5.23.0 1.07 v5.23.1 1.07