Object::props - Pragma to implement lvalue accessors with options
Included in OOTools 2.2 distribution.
The latest versions changes are reported in the Changes file in this distribution.
The distribution includes:
Pragma to implement lvalue accessors with options
Pragma to implement groups of properties accessors with options
Pragma to implement constructor methods
Delayed checking of object failure
Class utility functions
Perl version >= 5.6.1
perl -MCPAN -e 'install OOTools'
From the directory where this file is located, type:
perl Makefile.PL make make test make install
This pragma is very similar to the Class::props pragma: the main difference is the underlying variable that holds the value, which is a global scalar in the caller package instead in the class. For example:
Class::props
package BaseClass; use Package::props 'a_package_prop'; use Class::props 'a_class_prop'; package SubClass; our @ISA = 'BaseClass'; # underlaying scalar for accessor 'a_package_prop' is # $BaseClass::a_package_prop # underlaying scalar for accessor 'a_class_prop' is # $SubClass::a_class_prop;
This might seem a subtle difference, but the possible usage in inherited classes makes a big difference.
You can also call a package property accessor by statically using the implementing package name (e.g. BaseClass-a_prop>), regardless the subclass that uses it.
BaseClass-
See the documentation of the accessor properties in Class::props for all the details.
If you need support or if you want just to send me some feedback or request, please use this link: http://perl.4pro.net/?Object::props.
© 2004-2005 by Domizio Demichelis.
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as perl itself.
Thanks to Juerd Waalboer (http://search.cpan.org/author/JUERD) that with its Attribute::Property inspired the creation of this distribution.
9 POD Errors
The following errors were encountered while parsing the POD:
Expected text after =item, not a bullet
Non-ASCII character seen before =encoding in '©'. Assuming CP1252
To install Class::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Util
CPAN shell
perl -MCPAN -e shell install Class::Util
For more information on module installation, please visit the detailed CPAN module installation guide.