Yes thanks for this I did find it and it looks really promising but it dont work! I am using (excuse the mess I am trying to tweek it).
use File::stat;
my $file = "c:\\this.doc";
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blks)= stat($file);
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)= localtime($mtime);
$year= 1900 + $year;
print $dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blks;
print "mtime (the last modify time since the epoch): $mtime\n";
print "Applying mtime to localcaltime time we get: ";
printf(" %d-%d-%d\n",$mon+1,$mday,$year);
All I get is
C:\>utime.pl
File::stat=ARRAY(0x888728)mtime (the last modify time since the epoch):
Applying mtime to localcaltime time we get: 1-1-1970
I tried this on two machines. One is running perl 5.8 and both did the same thing. Still the weekend is here I might take a look later otherwise monday.
you get the star as the answer is perfect just need to get it to work!
I also tried your code like this
use File::stat;
my $file = "c:\\this.doc";
$mtime = (stat($file))[9];
print $mtime;
C:\>perl -w utime.pl
Use of uninitialized value at utime.pl line 4. ????
looks like a Monday prob Thanks again!