in reply to Most recently created file in a folder

localtime and perhaps POSIX::strftime. To get the most recent, List::Util::max.

$ perl -e'print scalar( localtime 1094551336), $/' Tue Sep 7 06:02:16 2004 $ perl -MPOSIX=strftime -e'print strftime "%d %B %Y, %T$/", localtime +1094551336' 07 September 2004, 06:02:16 $

Added: For a shortcut to the most recent time (without any information on which file it was), stat the mtime of the directory. That will tell the last time its inodes were changed.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Most recently created file in a folder
by bluto (Curate) on Sep 07, 2004 at 15:04 UTC
    Added: For a shortcut to the most recent time (without any information on which file it was), stat the mtime of the directory. That will tell the last time its inodes were changed.

    Unfortunately, the mtime for the directory will also be modified under other conditions as well (e.g. removal of a file), so it won't necessarily be correct.