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 => '$' });