Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *old_foo = *foo;
- require 'foo_killer.pl';
- *foo = *old_foo;
- {
- local *foo;
- require 'foo_killer.pl';
- }
- *old_foo = *foo{CODE};
- require 'foo_killer.pl';
- *foo = *old_foo{CODE};
- package Foo;
- use strict;
- use warnings;
- use Exporter;
- our @ISA = qw(Exporter);
- our @EXPORT_OK = qw(foo bar $evil $global $variables);
- do "foo_killer.pl"
- or die "Failed to load foo_killer.pl: ".($@ || $!);
- 1;
- my $foo_killer = __FILE__; # $LIB/Foo.pm
- $foo_killer =~ s,(/+[^/]+),legacy,; # $LIB/legacy
- $foo_killer .= "foo_killer.pl"; # $LIB/legacy/foo_killer.pl
- # now do $foo_killer;
Add Comment
Please, Sign In to add comment