print join "\n", sort @DirList;
prints sorted by file/dir name.
print join "\n", sort {-M $a <=> -M $b} @DirList;
prints sorted by modification date.
In reply to Re: sorting a directories content
by GrandFather
in thread sorting a directories content
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |