{
    "mode": "perldoc",
    "parameter": "Heap::Elem::RefRev",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Heap%3A%3AElem%3A%3ARefRev/json",
    "generated": "2026-06-12T20:56:47Z",
    "synopsis": "use Heap::Elem::RefRev( RefRElem );\nuse Heap::Fibonacci;\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\nforeach $i ( 1..100 ) {\n$obj = myObject->new( $i );\n$elem = RefRElem( $obj );\n$heap->add( $elem );\n}\nwhile( defined( $elem = $heap->extracttop ) ) {\n# assume that myObject object have a method I<printable>\nprint \"Largest is \", $elem->val->printable, \"\\n\";\n}",
    "sections": {
        "NAME": {
            "content": "Heap::Elem::RefRev - Reversed Object Reverence Heap Elements\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Heap::Elem::RefRev( RefRElem );\nuse Heap::Fibonacci;\n\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\n\nforeach $i ( 1..100 ) {\n$obj = myObject->new( $i );\n$elem = RefRElem( $obj );\n$heap->add( $elem );\n}\n\nwhile( defined( $elem = $heap->extracttop ) ) {\n# assume that myObject object have a method I<printable>\nprint \"Largest is \", $elem->val->printable, \"\\n\";\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Heap::Elem::RefRev is used to wrap object reference values into an element that can be managed\non a heap. Each referenced object must have a method *cmp* which can compare itself with any of\nthe other objects that have references on the same heap. These comparisons must be consistant\nwith normal arithmetic. The top of the heap will have the largest (according to *cmp*) element\nstill remaining. (See Heap::Elem::Ref if you want the heap to always return the smallest\nelement.)\n\nThe details of the Elem interface are described in Heap::Elem.\n\nThe details of using a Heap interface are described in Heap.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "John Macdonald, john@perlwolf.com\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 1998-2007, O'Reilly & Associates.\n\nThis code is distributed under the same copyright terms as perl itself.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Heap(3), Heap::Elem(3), Heap::Elem::Ref(3).\n",
            "subsections": []
        }
    },
    "summary": "Heap::Elem::RefRev - Reversed Object Reverence Heap Elements",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "Heap",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/Heap/3/json"
        },
        {
            "name": "Elem",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/Elem/3/json"
        },
        {
            "name": "Ref",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/Ref/3/json"
        }
    ]
}