Author image Leon Timmermans

NAME

Class::Private - Private hashes for your objects

VERSION

Version 0.05

SYNOPSIS

        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';

DESCRIPTION

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.

METHODS

new

This method creates a new private hash object.

AUTHOR

Leon Timmermans, <leont at cpan.org>

DEPENDENCIES

This module requires perl 5.10.

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Class::Private

You can also look for information at:

COPYRIGHT & LICENSE

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.