|
Posted by Ilja on March 17, 2005, 2:56 pm
Please log in for more thread options
Hi,
I would like to use the Heap module from CPAN to sort Hash of Hashes by
values,
keeping track of what pairs of keys belong to what values.
I am new to OO programming, so I don't quite understand how I can use
the Heap module for that.
The SYNOPSIS provided in the documentation for Heap:
use Heap::Elem::SomeInheritor;
use Heap::SomeHeapClass;
show/hide quoted text
$elem = Heap::Elem::SomeInheritor->new( $value );
$heap = Heap::SomeHeapClass->new;
show/hide quoted text
$heap->add($elem);
does not help me at this point. I don't see how one can create and get
attributes of the $elem, if needed(if that is the way to go).If anyone
has used Heap with Hash of Hashes before or knows how to do that, I
would appreciate any help.
|
$heap = Heap::SomeHeapClass->new;