Gossamer Forum
Home : General : Perl Programming :

how to sort???

Quote Reply
how to sort???
@unsort = (2,3,1,4,5,7,6);
how can i sort it to:
@sorted = (7,6,5,4,3,2,1);
???
Quote Reply
Re: how to sort??? In reply to
This will do:

Code:
@sort = sort {$b <=> $a} @unsort;

Cheers,
Polpus

------------------
WDresources
www.wdresources.com