Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::PublicPrivate 0.80

    Download button

    No screenshots available
    Downloads: 336  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.5/5)
    4 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Miko O'Sullivan | More programs
    Perl Artistic License / FREE
    February 22nd, 2008, 20:11 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    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.

    SYNOPSIS

    PublicPrivate 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";

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    private keys | base class | Perl module | Perl | Public | Private

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM