Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RFC: Sub::Prepend - Prepend code to named subroutines

by lodin (Hermit)
on Jun 05, 2008 at 07:12 UTC ( [id://690349]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Sub::Prepend 'prepend';
    
    ...
    __END__
    Foo was called with @_ = (3).
    Foo executed with @_ = (3).
    
  2. or download this
    my $old = \&foo;
    *foo = sub { ...; goto &$old };
    
  3. or download this
    use Scalar::Util 'set_prototype';
    
    ...
      no warnings 'redefine';
      *$name = $new;
    }
    
  4. or download this
    prepend(foo => sub { ... });
    
  5. or download this
    prepend(foo => sub ($) { ... });
    prepend(foo => sub { ... }, { prototype => '$' });
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://690349]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-16 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found