"Ash Varma" <[EMAIL PROTECTED]> writes:

> Hi..
>
> I have:
>
> $code[0][0] = "AAA"
> $code[0][1] = "19.5"
> $code[1][0] = "AAD"
> $code[1][1] = "20.0"
> $code[2][0] = "ZZZ"
> $code[2][1] = "10.7"
> $code[3][0] = "XXA"
> $code[3][1] = "5.9"
> $code[4][0] = "YXA"
> $code[4][1] = "27.1"
> $code[5][0] = "AZX"
> $code[5][1] = "1.9"
>
> What would be the best way to sort this?

Guessing you want to sort the list @code by it's first elements
alphabetically it's:

  sort { $a->[0] cmp $b->[0] } @code;

But you don't tell so that's just a guess.

--
 Christer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to