Skip to content

Instantly share code, notes, and snippets.

@haarg
Created July 14, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haarg/1d3f2059f3e3807f91a18e962c44f595 to your computer and use it in GitHub Desktop.
Save haarg/1d3f2059f3e3807f91a18e962c44f595 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use mro ();
BEGIN {
package Super;
use mro 'c3';
sub foo {
$_[0]->maybe::next::method;
}
}
BEGIN {
package Parent1;
BEGIN { our @ISA = qw(Super) }
use mro 'c3';
}
BEGIN {
package Parent2;
BEGIN { our @ISA = qw(Super) }
use mro 'c3';
}
BEGIN {
package Mine;
BEGIN { our @ISA = qw(Parent1 Parent2) }
use mro 'c3';
}
my $class = "Mine" . substr($ENV{PATH},0,0);
mro::get_linear_isa($class);
Mine->foo; # will recurse infinitely
$class->foo; # will die due to taint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment