Object::By::Existing_Reference - a minimalistic constructor for objects based on existing references
package some_package; use parent qw( Object::By::Existing_Reference Object::By::Array); sub _constructor { my ($this, ...) = @_; ... return; } package main; use some_package; my $reference = ...; some_package->constructor($reference, ...);
Object::By::Existing_Reference provides a generic constructor for OO programming, which is tailored to an actual class via a method called _constructor. The first argument to the constructor must be an existing reference.
This class can also be used to override constructor() from classes with
The design goal was a simple and robust API with a straightforward implementation, respecting all limitations of Perl 5.
A generic constructor for objects of the class. If the method _constructor is defined, calls _constructor and forwards any arguments to it. The data structure is locked afterwards.
There are no tests.
This module has been developed for the specific needs of FReDI and the Mica Environment. It is used by Mica, HTTP::Fools_Gold, Package::Aspect, Text::Placeholder and Object::Episode.
Winfried Trumper <pub+perl(a)wt.tuxomania.net>
Copyright (C) 2011, 2012 Winfried Trumper
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Object::By::Hash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::By::Hash
CPAN shell
perl -MCPAN -e shell install Object::By::Hash
For more information on module installation, please visit the detailed CPAN module installation guide.