Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Reading from file- not change atimeby Eliya (Vicar) |
on Dec 10, 2013 at 15:45 UTC ( [id://1066448]=note: print w/replies, xml ) | Need Help?? |
Actually, you shouldn't load the module File::stat when you say (stat($fh))[8,9], because the module overrides the stat builtin, and the overridden stat returns an object providing methods such as atime, mtime, etc., instead of a list of values... In other words, either simply don't use File::stat, or say something like
or even (if you like):
(Of course, you could also do away with the intermediate variables, and put the method calls directly in utime's argument list, i.e. utime($st->atime, $st->mtime, $fh), in case you're using File::stat).
In Section
Seekers of Perl Wisdom
|
|