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 > Libraries

    Class::Std 0.0.9

    Download button

    No screenshots available
    Downloads: 340  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.0/5)
    1 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Damian Conway | More programs
    Perl Artistic License / FREE
    March 25th, 2008, 11:45 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::Std description

    Class::Std is a Perl module to support for creating standard "inside-out" classes.

    Class::Std is a Perl module to support for creating standard "inside-out" classes.

    SYNOPSIS

    package MyClass;
    use Class::Std;

    # Create storage for object attributes...
    my %name : ATTR;
    my %rank : ATTR;
    my %snum : ATTR;

    my %public_data : ATTR;

    # Handle initialization of objects of this class...
    sub BUILD {
    my ($self, $obj_ID, $arg_ref) = @_;

    $name{$obj_ID} = check_name( $arg_ref->{name} );
    $rank{$obj_ID} = check_rank( $arg_ref->{rank} );
    $snum{$obj_ID} = _gen_uniq_serial_num();
    }

    # Handle cleanup of objects of this class...
    sub DEMOLISH {
    my ($self, $obj_ID) = @_;

    _recycle_serial_num( $snum{$obj_ID} );
    }

    # Handle unknown method calls...
    sub AUTOMETHOD {
    my ($self, $obj_ID, @other_args) = @_;

    # Return any public data...
    if ( m/A get_(.*)/ ) { # Method name passed in $_
    my $get_what = $1;
    return sub {
    return $public_data{$obj_ID}{$get_what};
    }
    }

    warn "Can't call $method_name on ", ref $self, " object";

    return; # The call is declined by not returning a sub ref
    }

    This module provides tools that help to implement the "inside out object" class structure in a convenient and standard way.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    create classes | inside-out classes | Perl module | Class::Std | create | standard

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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