Guest User

Untitled

a guest
Jan 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. *old_foo = *foo;
  2. require 'foo_killer.pl';
  3. *foo = *old_foo;
  4.  
  5. {
  6. local *foo;
  7. require 'foo_killer.pl';
  8. }
  9.  
  10. *old_foo = *foo{CODE};
  11. require 'foo_killer.pl';
  12. *foo = *old_foo{CODE};
  13.  
  14. package Foo;
  15. use strict;
  16. use warnings;
  17.  
  18. use Exporter;
  19. our @ISA = qw(Exporter);
  20. our @EXPORT_OK = qw(foo bar $evil $global $variables);
  21.  
  22. do "foo_killer.pl"
  23. or die "Failed to load foo_killer.pl: ".($@ || $!);
  24. 1;
  25.  
  26. my $foo_killer = __FILE__; # $LIB/Foo.pm
  27. $foo_killer =~ s,(/+[^/]+),legacy,; # $LIB/legacy
  28. $foo_killer .= "foo_killer.pl"; # $LIB/legacy/foo_killer.pl
  29. # now do $foo_killer;
Add Comment
Please, Sign In to add comment