Narveson has asked for the wisdom of the Perl Monks concerning the following question:
use subs qw(system); my $SYSTEM_SUCCESS = 0; sub system { print "***\n"; print "system @_\n"; print "***\n\n"; return $SYSTEM_SUCCESS; } local @ARGV = @test_args; do 'launch_rockets.pl';
So far so good. But launch_rockets.pl also contains
and lateruse Proc::Background;
Proc::Background->new('perl', 'launch_missiles.pl');
I could copy launch_rockets.pl into a sandbox where Proc::Background is replaced by a stub, but I was wondering if there was any override strategy that would be effective inside a do FILE call in the file's original environment.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overriding a module that is used by a program I'm testing
by cdarke (Prior) on Dec 08, 2010 at 08:40 UTC | |
|
Re: Overriding a module that is used by a program I'm testing
by dsheroh (Monsignor) on Dec 08, 2010 at 10:26 UTC | |
by Narveson (Chaplain) on Dec 08, 2010 at 15:17 UTC | |
by 7stud (Deacon) on Dec 10, 2010 at 00:50 UTC | |
by anonymized user 468275 (Curate) on Dec 08, 2010 at 22:38 UTC | |
by dsheroh (Monsignor) on Dec 09, 2010 at 09:06 UTC | |
|
Re: Overriding a module that is used by a program I'm testing
by belden (Friar) on Dec 09, 2010 at 22:06 UTC |