Data::Grove::Parent



Data::Grove::Parent

NAME
SYNOPSIS
DESCRIPTION
METHODS
AUTHOR
SEE ALSO

NAME

Data::Grove::Parent − provide parent properties to Data::Grove objects

SYNOPSIS

 use Data::Grove::Parent;
 $root = $object−>root;
 $rootpath = $object−>rootpath;
 $tied = $object−>add_magic([ $parent ]);
 $node = Data::Grove::Parent−>new($hash [, $parent]);
 $node_list = Data::Grove::ParentList−>new($array [, $parent]);

DESCRIPTION

Data::Grove::Parent is an extension to Data::Grove that adds ‘"Parent"’ and ‘"Raw"’ properties to Data::Grove objects and methods for returning the root node of a grove, a list of nodes between and including the root node and the current node, and a method that creates parented nodes.

Data::Grove::Parent works by creating a Perl ‘‘tied’’ object that contains a parent reference (‘"Parent"’) and a reference to the original Data::Grove object (‘"Raw"’). Tying-magic is used so that every time you reference the Data::Grove::Parent object it actually references the underlying raw object.

When you retrieve a list or a property of the Raw object, Data::Grove::Parent automatically adds magic to the returned list or node. This means you only call ‘add_magic()’ once to create the first Data::Grove::Parent object and then use the grove objects like you normally would.

The most obvious use of this is so you don’t have to call a ‘"delete"’ method when you want to release a grove or part of a grove; since Data::Grove and Data::Grove::Parent objects have no cyclic references, Perl can garbage collect them normally.

A secondary use is to allow you to reuse grove or property set fragments in multiple trees. WARNING: Data::Grove currently does not protect you from creating your own cyclic references! This could lead to infinite loops if you don’t take care to avoid them.

METHODS

$object−>root()
$object−>rootpath()

"root()"’ returns the root node if ‘$object’ is a ‘"Data::Grove::Parent"’ object. ‘"rootpath()"’ returns an array of all the nodes between and including the root node and ‘$object’.

$tied = $object−>add_magic([ $parent ])

"add_magic()"’ returns a "Data::Grove::Parent" object with ‘$object’ as it’s ‘"Raw"’ object. If ‘$parent’ is given, that becomes the tied object’s parent object.

AUTHOR

Ken MacLeod, ken@bitsko.slc.ut.us

SEE ALSO

perl(1), Data::Grove(3)






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.