Help for this page

Select Code to Download


  1. or download this
    my @sorted_aoh = sort {
        (map /^doc(\d+)/ ? 0+$1 : (), keys(%$a))[0]
        <=>
        (map /^doc(\d+)/ ? 0+$1 : (), keys(%$b))[0]
    } @aoh;
    
  2. or download this
    my @sorted_aoh =
    map $aoh[ substr $_, 5 ],
    sort
    ...
        # Return the document number, a null and the original array index
        pack( 'N', $doc_key ) . "\0" . $_;
    } 0 .. $#aoh