[ABE.pm] sorting an AoA

Faber J. Fedor faber at linuxnj.com
Wed Jul 26 12:24:59 PDT 2006


I've got an array of arrays, to wit:

my @array1    = ( ["company1", "1"],
                  ["company2", "3"],
                  ["company3", "1.5"],
                )

I need to numerically sort the AoA by the second column so I have

my array2  = ( ["company1", "1"],
               ["company3", "1.5"],
               ["company2", "3"],
             )

Everything sort example I've seen so far returns an array of single
values, i.e.

my @array3 = ( "1",
               "1.5",
               "3",
             )

How do I get @array1 sorted into @array2?  


-- 
 
Regards,
 
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701

http://www.linuxnj.com





More information about the ABE-pm mailing list