{
    "content": [
        {
            "type": "text",
            "text": "# Data::Grove::Parent (perldoc)\n\n## NAME\n\nData::Grove::Parent - provide parent properties to Data::Grove objects\n\n## SYNOPSIS\n\nuse Data::Grove::Parent;\n$root = $object->root;\n$rootpath = $object->rootpath;\n$tied = $object->addmagic([ $parent ]);\n$node = Data::Grove::Parent->new($hash [, $parent]);\n$nodelist = Data::Grove::ParentList->new($array [, $parent]);\n\n## DESCRIPTION\n\nData::Grove::Parent is an extension to Data::Grove that adds `\"Parent\"' and `\"Raw\"' properties\nto Data::Grove objects and methods for returning the root node of a grove, a list of nodes\nbetween and including the root node and the current node, and a method that creates parented\nnodes.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **AUTHOR**\n- **SEE ALSO** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Data::Grove::Parent",
        "section": "",
        "mode": "perldoc",
        "summary": "Data::Grove::Parent - provide parent properties to Data::Grove objects",
        "synopsis": "use Data::Grove::Parent;\n$root = $object->root;\n$rootpath = $object->rootpath;\n$tied = $object->addmagic([ $parent ]);\n$node = Data::Grove::Parent->new($hash [, $parent]);\n$nodelist = Data::Grove::ParentList->new($array [, $parent]);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 1,
                "subsections": [
                    {
                        "name": "perl",
                        "lines": 1
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "Data::Grove::Parent - provide parent properties to Data::Grove objects\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Data::Grove::Parent;\n\n$root = $object->root;\n$rootpath = $object->rootpath;\n$tied = $object->addmagic([ $parent ]);\n\n$node = Data::Grove::Parent->new($hash [, $parent]);\n$nodelist = Data::Grove::ParentList->new($array [, $parent]);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Data::Grove::Parent is an extension to Data::Grove that adds `\"Parent\"' and `\"Raw\"' properties\nto Data::Grove objects and methods for returning the root node of a grove, a list of nodes\nbetween and including the root node and the current node, and a method that creates parented\nnodes.\n\nData::Grove::Parent works by creating a Perl ``tied'' object that contains a parent reference\n(`\"Parent\"') and a reference to the original Data::Grove object (`\"Raw\"'). Tying-magic is used\nso that every time you reference the Data::Grove::Parent object it actually references the\nunderlying raw object.\n\nWhen you retrieve a list or a property of the Raw object, Data::Grove::Parent automatically adds\nmagic to the returned list or node. This means you only call `addmagic()' once to create the\nfirst Data::Grove::Parent object and then use the grove objects like you normally would.\n\nThe most obvious use of this is so you don't have to call a `\"delete\"' method when you want to\nrelease a grove or part of a grove; since Data::Grove and Data::Grove::Parent objects have no\ncyclic references, Perl can garbage collect them normally.\n\nA secondary use is to allow you to reuse grove or property set fragments in multiple trees.\nWARNING: Data::Grove currently does not protect you from creating your own cyclic references!\nThis could lead to infinite loops if you don't take care to avoid them.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "$object->root()\n$object->rootpath()\n`\"root()\"' returns the root node if `$object' is a `\"Data::Grove::Parent\"' object.\n`\"rootpath()\"' returns an array of all the nodes between and including the root node and\n`$object'.\n\n$tied = $object->addmagic([ $parent ])\n`\"addmagic()\"' returns a \"Data::Grove::Parent\" object with `$object' as it's `\"Raw\"'\nobject. If `$parent' is given, that becomes the tied object's parent object.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Ken MacLeod, ken@bitsko.slc.ut.us\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "",
                "subsections": [
                    {
                        "name": "perl",
                        "content": ""
                    }
                ]
            }
        }
    }
}