Help for this page
my @sorted_aoh = sort { (map /^doc(\d+)/ ? 0+$1 : (), keys(%$a))[0] <=> (map /^doc(\d+)/ ? 0+$1 : (), keys(%$b))[0] } @aoh;
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