in reply to Open files by date created
Use sort...
$datapath = "/Users/code/data"; my @allfiles = sort { -M $a <=> -M $b } <$datapath/*.*>; foreach $item (@allfiles) { # parsing... }
Actually, as I dislike unnecessary variables, I'd probably write it as:
$datapath = "/Users/code/data"; foreach (sort { -M $a <=> -M $b } <$datapath/*.*>) { # filename is in $_ }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|