> -----Original Message-----
> From: Dolfen, Stefan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 29, 2001 3:44 AM
> To: 'Neil Fryer'
> Cc: '[EMAIL PROTECTED]'
> Subject: AW: newbie : how to find the latest file in a directory
> 
> 
> I thought this is a perl mailinglist, not a unix ....
> I need a function in perl to find the latest file

How about (put this all on one line:)

perl -e '(stat)[9] > $mtime && ($latest=$_, $mtime=(stat _)[9]) for @ARGV;
END { print "$latest\n" }' *

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to