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

    Hook::PrePostCall 1.2 Alpha

    Download button

    No screenshots available
    Downloads: 312  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Philippe Verdret | More programs
    Perl Artistic License / FREE
    May 24th, 2007, 06:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Hook::PrePostCall description

    Hook::PrePostCall is a Perl module that can add actions before and after a routine.

    Hook::PrePostCall is a Perl module that can add actions before and after a routine.

    SYNOPSIS

    require 5.000;
    use Hook::PrePostCall;

    sub try {
    print STDERR "in try: @_n";
    @_;
    }

    PrePostCall->new(
    'try',
    sub {
    print STDERR "pre: @_n";
    # process the @_ content...if you want
    @_; # defines the 'try' arguments
    },
    sub {
    print STDERR "post: @_n";
    # process the @_ content...if you want
    @_; # defines what the 'try' returns
    }
    );
    print try(10), "n";

    new() creates a new object of the Hook::PrePostCall class. Arguments of the new method are:

    1. the name of the primary routine you want to "overload",
    2. an anonymous routine to call before the primary routine,
    3. an anonumous routine to call after the primary routine.

    If the name of the primary subroutine has not an explicit package prefix, it is assumed to be the name of a subroutine in the current package of the caller of the new() method.

    The pre routine acts as a filter of the primary routine arguments. The post routine acts as a filter of what the primary returns.

    new() can be used as a class or an object method. When used as an object method the derived definition is built from the initial definition of the primary routine.

    derived() Returns the overloaded routine.

    pre() Returns or set the pre action part.

    post() Returns or set the post action part.

    primary() Returns the primary routine.

    restore() Retore initial definition of the primary routine.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    routine actions | add actions | Perl module | Hook::PrePostCall | routine | actions

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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