Help for this page

Select Code to Download


  1. or download this
    @array = (["filename1",1],["filename2",1,2,3],["filename3",3,2]);
    @array = sort {$#$b <=> $#$a} @array;
    for (@array){
        print $$_[0];
    }
    
  2. or download this
    %hash = ("filename1" => [1], "filename2" => [1,2,3], "filename3" => [3
    +,2]);
    @sortedkeys = sort {$#{$hash{$b}} <=> $#{$hash{$a}} } keys (%hash);
    print @sortedkeys;