APM: Sorting the output of readdir in reverse order

Ian Ragsdale ian at SKYLIST.net
Fri Nov 19 16:24:29 CST 2004


while (defined($File = readdir(DIR))) {
   push @files, $File;
}

@files = sort { $b cmp $a } @files;

On Nov 19, 2004, at 5:12 PM, Bakken, Tom - Temple, TX wrote:

> How would I sort the output of the readdir function in reverse order?
>
> while (defined($File = readdir(DIR))) {
>   do something
> }
>
> I've tried various things, all of them messy and failures.
>
> Tom Bakken
>
> _______________________________________________
> Austin mailing list
> Austin at mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin



More information about the Austin mailing list