opendir requires closedir (not close).
A common technique when using sort is to precalculate anything expensive (-M in this case) using a map before the sort then extract the desired data using another map after the sort:
my @list = map {$_->[1]} sort { $a->[0] <=> $b->[0] } map {[-M "$maillog_dir/$_", $_]} ...
In reply to Re: rename files with mtime
by GrandFather
in thread rename files with mtime
by pbaumgar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |