Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 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

    Object::Lazy 0.13

    Download button

    No screenshots available
    Downloads: 75  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steffen Winkler | More programs
    Perl Artistic License / FREE
    September 26th, 2012, 23:12 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Object::Lazy description

    create objects late from non-owned (foreign) classes

    Object::Lazy is a Perl module that implements lazy evaluation. It is also able to create lazy objects from any class.

    SYNOPSIS

     use Foo 123; # because the class of the real object is Foo, version could be 123
     use Object::Lazy;

     my $foo = Object::Lazy->new(
     sub {
     return Foo->new;
     },
     );

     bar($foo);

     sub bar {
     my $foo = shift;

     if ($condition) {
     # a foo object will be created
     print $foo->output;
     }
     else {
     # foo object is not created
     }

     return;
     }


    To combine it write somthing like:

     use Object::Lazy;

     my $foo = Object::Lazy->new(
     sub {
     # 3 lines instead of "use Foo 123"
     require Foo;
     Foo->import;
     Foo->VERSION('123');
     return Foo->new;
     },
     );

     # and so on


    After that the object will be updated too:

     $object->method;
     ^^^^^^^-------------- will update this scalar after a build



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    object buidler | lazy objects | lazy evaluation | object | buidler | foreign

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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