in reply to Sort Array Reference by Numeric First Element

Hi awohld,

You're very close.  What you want is to remove the '@' signs on the array references, and to put '[ ... ]' around the sort:

my $array2 = [ sort { $a->[0] <=> $b->[0] } @$array ];

That should do what you need!


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/