On Tue, 20 Nov 2001, Franck FASANO wrote:

> Here is a little code :
>
> --------------
> my @trav= ( 1, 12, 5, 3);
> @trav=sort { $b cmp $a } @trav;
>
> foreach (@trav) {
>  print " $_ ";
> }
> --------------
>
> After exec, we have :
>  5  3  12  1

You're using the wrong operator.  You want { $b <=> $a} for your
comparison.

-- Brett

                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Everybody has something to conceal.
                -- Humphrey Bogart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to