Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: "Backing up" a subroutine during runtime.

by TGI (Parson)
on Oct 21, 2008 at 18:49 UTC ( [id://718561] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    #$f->fake_function( 'Fake');  # program will die
  2. or download this
    $f->override( 'test::function', sub { print 'foo' } );
    # Do your testing;
    $f->restore( 'test::function' );