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

    load 0.19

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Elizabeth Mattijsen | More programs
    Perl Artistic License / FREE
    May 19th, 2008, 15:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    load description

    load is a Perl module to control when subroutines will be loaded.

    load is a Perl module to control when subroutines will be loaded.

    SYNOPSIS

    use load; # default, same as 'autoload'

    use load 'autoload'; # export AUTOLOAD handler to this namespace

    use load 'ondemand'; # load subroutines after __END__ when requested, default

    use load 'now'; # load subroutines after __END__ now

    use load (); # same as qw(dontscan inherit)

    use load 'dontscan'; # don't scan module until it is really needed

    use load 'inherit'; # do NOT export AUTOLOAD handler to this namespace


    The "load" pragma allows a module developer to give the application developer more options with regards to optimize for memory or CPU usage. The "load" pragma gives more control on the moment when subroutines are loaded and start taking up memory. This allows the application developer to optimize for CPU usage (by loading all of a module at compile time and thus reducing the amount of CPU used during the execution of an application). Or allow the application developer to optimize for memory usage, by loading subroutines only when they are actually needed, thereby however increasing the amount of CPU needed during execution.

    The "load" pragma combines the best of both worlds from AutoLoader and SelfLoader. And adds some more features.

    In a situation where you want to use as little memory as possible, the "load" pragma (in the context of a module) is a drop-in replacement for AutoLoader. But for situations where you want to have a module load everything it could ever possibly need (e.g. when starting a mod_perl server in pre-fork mode), the "load" pragma can be used (in the context of an application) to have all subroutines of a module loaded without having to make any change to the source of the module in question.

    So the typical use inside a module is to have:

    package Your::Module;
    use load;


    in the source. And to place all subroutines that you want to be loadable on demand after the (first) __END__.

    If an application developer decides that all subroutines should be loaded at compile time, (s)he can say in the application:

    use load 'now';
    use Your::Module;


    This will cause the subroutines of Your::Module to all be loaded at compile time.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    control subroutines | load subroutines | Perl module | control | subroutines | loading

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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