Class::Private - Private hashes for your objects
Version 0.05
package Your::Class; use Class::Private; sub new { my $class = shift; my $self = Class::Private->new(); $self->{foo} = 'bar'; return bless $self, $class; } package main; my $object = Your::Class->new; # This will not affect the internal value $object->{foo} = 'quz'; # This will $object->{'Your::Class::foo'} = 'quz';
This module provides some level of encapsulation around hashrefs for objects. It does this by transforming every key into package::key. This way you won't have collisions. If the key contains ::, it will not be transformed, and normal access takes place. Thus keys from other packages can be accessed explicitly if necessary.
key
package::key
::
This method creates a new private hash object.
Leon Timmermans, <leont at cpan.org>
<leont at cpan.org>
This module requires perl 5.10.
Please report any bugs or feature requests to bug-class-private at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Private. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-class-private at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Class::Private
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Private
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Class-Private
CPAN Ratings
http://cpanratings.perl.org/d/Class-Private
Search CPAN
http://search.cpan.org/dist/Class-Private
Copyright 2009, 2010 Leon Timmermans, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Class::Private, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Private
CPAN shell
perl -MCPAN -e shell install Class::Private
For more information on module installation, please visit the detailed CPAN module installation guide.