|
NAMEConfig::AST::Node::Section - Configuration section node.DESCRIPTIONNodes of this class represent configuration sections in the AST.METHODSnew(ROOT, ARG => VAL, ...)Creates new section object. ROOT is the root object of the tree or the Config::AST object. The ARG => VAL pairs are passed to the parent class constructor (see Config::AST::Node).$t = $node->subtreeReturns tree containing all subordinate nodes of this node.$t = $node->subtree($key)Returns the subnode at $key or undef if there is no such subnode.$t = $node->subtree($key => $value)Creates new subnode with the given $key and $value. Returns the created node.@a = $node->keys;Returns a list of names of all subordinate statements in this section.$bool = $node->has_key($str)Returns true if statement with name $str is present in the section described by $node.$node->delete($name)Deletes the node with name $name. Returns the removed node, or "undef" if not found.$node->merge($other)Merges the section $other (a Config::AST::Node::Section) to $node.$h = $cfg->as_hash$h = $cfg->as_hash($map)Returns parse tree converted to a hash reference. If $map is supplied, it must be a reference to a function. For each $key/$value pair, this function will be called as:($newkey, $newvalue) = &{$map}($what, $key, $value) where $what is "section" or "value", depending on the type of the hash entry being processed. Upon successful return, $newvalue will be inserted in the hash slot for the key $newkey. If $what is "section", $value is always a reference to an empty hash (since the parse tree is traversed in pre-order fashion). In that case, the $map function is supposed to do whatever initialization that is necessary for the new subtree and return as $newvalue either $value itself, or a reference to a hash available inside the $value. For example: sub map { my ($what, $name, $val) = @_; if ($name eq 'section') { $val->{section} = {}; $val = $val->{section}; } ($name, $val); } $s = $node->as_stringReturns the string "(section)".SEE ALSOConfig::AST, Config::AST::Node.
Visit the GSP FreeBSD Man Page Interface. |