RosettaCodeData/Task/File-modification-time/Perl/file-modification-time.pl
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

9 lines
281 B
Perl

my $mtime = (stat($file))[9]; # seconds since the epoch
# you should use the more legible version below:
use File::stat qw(stat);
my $mtime = stat($file)->mtime; # seconds since the epoch
utime(stat($file)->atime, time, $file);
# keep atime unchanged
# set mtime to current time