Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Wednesday February 18, 2009
03:59 PM

Is there a module that lobotomizes subroutines?

[ #38506 ]

Is there already a module that will turn a list of subroutines into no-ops? I'm doing this to disable features in production code, not testing, and only because other work-arounds are intractable. It's monkeypatching to give a class a lobotomy.

I know about Curtis's Sub::Override, so I might just write a wrapper around that for an interface that looks something like:

use Sub::Nerf;
 
nerf( $return_value, @list_of_subs );  # all subs just return $return_value
 
unnerf( @list_of_subs ); # back to where we started

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.