GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Config::AST::Node(3) User Contributed Perl Documentation Config::AST::Node(3)

Config::AST::Node - generic configuration syntax tree node

use parent 'Config::AST::Node';

This is an abstract class representing a node in the configuration parse tree. A node can be either a non-leaf node, representing a section, or a leaf node, representing a simple statement.

Creates new object. Recognized arguments are:
clone => OBJ
Clone object OBJ, which must be an instance of Config::AST::Node or its derived class.
default => VAL
Sets default value.
locus => LOC
Sets the locus - an object of class Text::Locus, which see.
file => NAME
Sets the file name.
order => N
Sets ordinal number.

Returns a locus associated with the node.

Associates a locus with the node. In the second form, a new locus object is created for location $FILE:$LINE.

Returns or sets and returns ordinal number for the node.

Returns or sets and returns default value for the node.

Returns true if node is a leaf node

Returns true if node is a null node

Returns true if node represents a section.

Returns true if node represents a value (or statement).

Returns a flattened representation of the configuration, as a list of pairs [ $path, $value ], where $path is a reference to the variable pathname, and $value is a Config::AST::Node::Value object.

The $sort argument controls the ordering of the entries in the returned @array. It is either a code reference suitable to pass to the Perl sort function, or one of the following constants:

NO_SORT
Don't sort the array. Statements will be placed in an apparently random order.
SORT_NATURAL
Preserve relative positions of the statements. Entries in the array will be in the same order as they appeared in the configuration file. This is the default.
SORT_PATH
Sort by pathname.

These constants are not exported by default. You can either import the ones you need, or use the :sort keyword to import them all, e.g.:

    use Config::AST::Node qw(:sort);
    @array = $node->flatten(sort => SORT_PATH);

Returns the canonical string representation of the configuration node. For value nodes, canonical representation is:

    QVAR=VALUE

where QVAR is fully qualified variable name, and VALUE is the corresponding value.

For sections, canonical representation is a list of canonical representations of the underlying nodes, delimited by newlines (or another character - see the description of the delim argument, below). The list is sorted by QVAR in ascending lexicographical order.

%args are zero or more of the following keywords:

delim => STR
Use STR to delimit statements, instead of the newline.
locus => 1
Prefix each statement with its location.

Config::AST, Config::AST::Node::Null, Config::AST::Node::Value, Config::AST::Node::Section.
2019-08-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.