Class::PublicPrivateClass::PublicPrivate is a Perl class with public keys with any name and a separate set of private keys. | |
Download |
Class::PublicPrivate Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Miko O'Sullivan
- Publisher web site:
- http://search.cpan.org/~miko/
Class::PublicPrivate Tags
Class::PublicPrivate Description
Class::PublicPrivate is a Perl class with public keys with any name and a separate set of private keys. Class::PublicPrivate is a Perl class with public keys with any name and a separate set of private keys.SYNOPSISPublicPrivate is intended for use as a base class for other classes. Users of class based on PublicPrivate can assign any keys to the object hash without interfering with keys used internally. The private data can be accessed by retrieving the private hash with the private method. For example, the following code outputs two different values, one for the public value of start and another for the private value of start. package ExtendedClass; use Class::PublicPrivate; @ExtendedClass::ISA=('Class::PublicPrivate'); sub new{ my $class = shift; my $self = $class->SUPER::new(); my $private = $self->private; # initialize one of the private properties $private->{'start'}=time(); return $self; } package main; my ($var); $var = ExtendedClass->new(); $var->{'start'} = 1; print $var->{'start'}, "n"; print $var->private()->{'start'}, "n"; Requirements: · Perl
Class::PublicPrivate Related Software