Reputation: 1005
I have a standalone version of Perl for Windows (5.004) that does not include any modules. I want to run a script to check the last modified time of several files.
I could use File::qstat
, but that module doesn't exist (the copy of Perl is in version control, so it can be used by people who do not have ActivePerl or Strawberry Perl installed).
It seems like there are three options:
use lib
(does that work on 5.004?)How can I do this?
Upvotes: 0
Views: 1063
Reputation: 7516
perl -le '$file=shift or die;print scalar localtime((stat($file))[9])' file
See stat .
Upvotes: 4
Reputation: 753950
Why on earth are you stuck using Perl 5.004? I have source from Perl 5.5.3 dated in 1999, so Perl 5.004 is likely to be several years older than that. (I found source for Perl 5.004_04 after all; the latest timestamp in that was 1997-10-15 06:46.) So, that's about 15 years old.
The stat
function is likely to exist and do the job you need.
Upvotes: 1