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.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::Default 1.51

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Adam Kennedy | More programs
    Perl Artistic License / FREE
    January 9th, 2008, 02:55 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::Default description

    Class::Default - static calls apply to a default instantiation.

    Class::Default - static calls apply to a default instantiation.

    SYNOPSIS

    # Create the defaulted class
    package Foo::Base;

    use base 'Class::Default';

    sub new { bless {}, $_[0] }

    sub show {
    my $self = shift->_self;
    "$self";
    }

    # Do something to the default object

    package main;

    print Foo::Bar->show;

    # Prints 'Foo::Bar=HASH(0x80d22f8)'

    Class::Default provides a mechanism to allow your class to take static method calls and apply it to a default instantiation of an object. It provides a flexibility to an API that allows it to be used more confortably in different situations.

    A good example of this technique in use is CGI.pm. When you use a static method, like CGI-header>, your call is being applied to a default instantiation of a CGI object.

    This technique appears to be especially usefull when writing modules that you want to be used in either a single use or a persistant environment. In a CGI like environment, you want the simplicity of a static interface. You can call Class-method> directly, without having to pass an instantiation around constantly.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    static calls | default instantiation | Perl module | static | calls | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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