{
    "mode": "perldoc",
    "parameter": "Heap::Elem::Num",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Heap%3A%3AElem%3A%3ANum/json",
    "generated": "2026-06-09T18:29:27Z",
    "synopsis": "use Heap::Elem::Num( NumElem );\nuse Heap::Fibonacci;\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\nforeach $i ( 1..100 ) {\n$elem = NumElem( $i );\n$heap->add( $elem );\n}\nwhile( defined( $elem = $heap->extracttop ) ) {\nprint \"Smallest is \", $elem->val, \"\\n\";\n}",
    "sections": {
        "NAME": {
            "content": "Heap::Elem::Num - Numeric Heap Elements\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Heap::Elem::Num( NumElem );\nuse Heap::Fibonacci;\n\nmy $heap = Heap::Fibonacci->new;\nmy $elem;\n\nforeach $i ( 1..100 ) {\n$elem = NumElem( $i );\n$heap->add( $elem );\n}\n\nwhile( defined( $elem = $heap->extracttop ) ) {\nprint \"Smallest is \", $elem->val, \"\\n\";\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Heap::Elem::Num is used to wrap numeric values into an element that can be managed on a heap.\nThe top of the heap will have the smallest element still remaining. (See Heap::Elem::NumRev if\nyou want the heap to always return the largest element.)\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::NumRev(3).\n",
            "subsections": []
        }
    },
    "summary": "Heap::Elem::Num - Numeric 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": "NumRev",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/NumRev/3/json"
        }
    ]
}