Subject: | NEXT::DISTINCT not skipping seen classes |
The example code in the NEXT documentation isn't working. This is on Red Hat 7 and 8, I think.
Here's the program (copied and pasted from the docs with an extra print statement) followed by its output.
use NEXT;
package A;
sub foo { print "called A::foo\n"; shift->NEXT::DISTINCT::foo() }
package B;
sub foo { print "called B::foo\n"; shift->NEXT::DISTINCT::foo() }
package C; @ISA = qw( A );
sub foo { print "called C::foo\n"; shift->NEXT::DISTINCT::foo() }
package D; @ISA = qw(A B);
sub foo { print "called D::foo\n"; shift->NEXT::DISTINCT::foo() }
package E; @ISA = qw(C D);
sub foo { print "called E::foo\n"; shift->NEXT::DISTINCT::foo() }
print "\$NEXT::VERSION=$NEXT::VERSION\n";
E->foo();
Show quoted text
> perl next.pl
$NEXT::VERSION=0.52
called E::foo
called C::foo
called A::foo
called D::foo
called A::foo
called B::foo
Note the second call to A::foo.
Many thanks,
Nat