NAME

Text::StructuredBase - Structured text subclass

SYNOPSIS

use base qw/Text::StructuredBase/;


$object->debug($n);

DESCRIPTION

Text::StructuredBase acts as a base class for Text::Structured.

BASE CLASS METHODS

AUTOLOAD()

AUTOLOAD() provides default accessor methods (apart from DESTROY()) for any of its subclasses. For AUTOLOAD() to catch calls to these methods objects must be implemented as an anonymous hash. Object attributes must

*) have UPPER CASE names
*) have keys in attribute _PERMITTED (an anonymous hash)

The name accessor method is the name of the attribute in lower case. The 'set' versions of these accessor methods require a single scalar argument (which could of course be a reference.) Both 'set' and 'get' versions return the attribute's value.

Special Attributes

/_L$/

Attribute names matching the pattern /_L$/ will be treated as arrayrefs. These accessors require an arrayref as an argument. If the attribute is defined they return the arrayref, otherwise they return an empty arrayref.

A method *_l_add(@foo) can be called on this type of attribute to add the elements in @foo to the array. If the attribute is defined they return the arrayref, otherwise they return an empty arrayref.

/_H$/

Attribute names matching the pattern /_H$/ will be treated as hashrefs. These accessors require a reference to an array containing key/value pairs. If the attribute is defined they return the hashref, otherwise they return an empty hashref.

A method *_h_byname(@list) can be called on this type of attribute. These methods will return a list which is the hash slice of the _H attribute value over @list or an empty list if the attribute is undefined.

A method *_h_add(\%foo) can be called on this type of attribute to add the elements in %foo to the hash. If the attribute is defined they return the hashref, otherwise they return an empty hashref.

debug($n)

As a class method sets the class attribute $Debugging to $n. As an object method sets the object attribute $_DEBUG to $n.

AUTHOR

Paul Sharpe <paul@miraclefish.com>

COPYRIGHT

Copyright (c) 1999 Paul Sharpe. England. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.