in reply to Sort an array which contains date formatted elements
If you can be assured that your files are not altered after the log moves on (big assumption that must be verified), you might just use a 'stat' mtime as your sort key.
Also, if you want to do a system call using backtics, you can let the file system sort your files for you (assuming UNIX).
my $files = `/bin/ls -1tr $dir`; my @files = grep { ! -d "$dir/$_" and ! /user.log/ } split /\n/, $file +s;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Sort an array which contains date formatted elements
by msk_0984 (Friar) on Jul 20, 2007 at 06:40 UTC |
In Section
Seekers of Perl Wisdom