in reply to Mind Bending Arrays
and here is an example of using a hash (note you need an array to store the order of the keys)@array = (["filename1",1],["filename2",1,2,3],["filename3",3,2]); @array = sort {$#$b <=> $#$a} @array; for (@array){ print $$_[0]; }
I hope this helps.%hash = ("filename1" => [1], "filename2" => [1,2,3], "filename3" => [3 +,2]); @sortedkeys = sort {$#{$hash{$b}} <=> $#{$hash{$a}} } keys (%hash); print @sortedkeys;
|
|---|