Win has asked for the wisdom of the Perl Monks concerning the following question:
I have a bit of code as follows:
What is the most efficient way of sorting the files in @lowest_priority by time created. I would like to do this in the foreach clause, if this is the best way of doing it.opendir (LOWEST, "<$input_directory_lowest") or die "Error opening d +irectory: $!"; foreach (sort grep(/^Flat_file.*\.txt$/,readdir(LOWEST))) { push @lowest_priority,$_; } closedir LOWEST;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sorting files by date
by davorg (Chancellor) on Feb 05, 2007 at 10:57 UTC | |
| |
| |
Re: sorting files by date
by marto (Cardinal) on Feb 05, 2007 at 11:04 UTC | |
| |
Re: sorting files by date
by shmem (Chancellor) on Feb 05, 2007 at 13:47 UTC | |
Re: sorting files by date
by Moron (Curate) on Feb 05, 2007 at 14:01 UTC | |
Re: sorting files by date
by Thelonius (Priest) on Feb 06, 2007 at 16:18 UTC |
Back to
Seekers of Perl Wisdom