[Israel.pm] sort of tow dimensional array

rami doqa rod082 at yahoo.com
Mon Jun 26 09:03:48 PDT 2006

hello . i am trying to sort the tow dimensional array
with depending on the element [0] for each row:

my @array = ();
 $array[0] = [100,'text_0'];
 $array[1] = [109,'text_1'];
 $array[n] = [80, 'text_n'];

when I do the sorting like this:

foreach $row(sort {$a <=> $b} @array)
   print $row->[0] . "," . $row->[1];  # i want to 
#sort by the first index which must be $row->[0] = 80

i noticed that the array is sorted ascending depending
on the index of each row

so i need a help how can i sort by the $array[$i][0]
for each rows of the array.

Dakka, Rami

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Perl mailing list