in reply to Re: splitting array values
in thread splitting array values

It looks like your making one long string in $rank, the equivalent of:$rank .= " " . $key; I'm guessing that your array has one element with one long string in it, so it looks like it's not sorted.

If you just want to get a sorted list of the keys, you can do:

@sorted = sort { $b <=> $a } keys %rank;
Notice you don't have to do a reverse, you can just change the sense of the comparison.

Replies are listed 'Best First'.
Re: Re (2): splitting array values
by mkurtis (Scribe) on May 20, 2004 at 04:05 UTC
    I tried sorting the keys like you said VSarkiss, but it still doesn't change the order when I sort them, or when I reverse them either.

    thanks