in reply to Re: how to list the files in dir with respect to time
in thread how to list the files in dir with respect to time
my %file_date; for ( glob '/path/to/*.log' ) { $file_date{$_} = (stat)[9]; } my $newest = ( sort { $file_date{$b} <=> $file_date{$a} } keys %file_a +ge )[0];
(update: changed name of hash to be consistent with what it stores)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to list the files in dir with respect to time
by Zaxo (Archbishop) on Aug 02, 2005 at 03:36 UTC | |
|
Re^3: how to list the files in dir with respect to time
by sk (Curate) on Aug 02, 2005 at 03:40 UTC | |
by graff (Chancellor) on Aug 02, 2005 at 03:44 UTC | |
by sk (Curate) on Aug 02, 2005 at 03:46 UTC |