in reply to Heap sorting in perl
Read that Heap.pm, and its default implementation Heap::Fibonacci. To be frank, don't have a good impression.
The biggest problem I have with it is the storage it used. It used a tree based on hash, instead of a tree based on N-sequential array. A hash uses more memory than n-sequential array, and slower in indexing as "N-sequential" is not utilized.
A N-sequential array is physically just a conventional array, but its element are specially positioned within the array, and can be easily viewed/used as a tree (in this case a heap).