#perl package Foo; sub foo{print "got here";print $x++;print "\n";my $s=shif +t;die if $x>10;$s->SUPER::foo;} package Bar;@ISA=qw/Foo/; package Baz;@ISA=qw/Bar/; package main; my $f=bless {},Baz;$f->foo; # now hit Ctrl+D ... got here0 Can't locate object method "foo" via package "Foo" (perhaps you forgot + to load "Foo"?) at - line 2. #
Is this a bug? Why can't Foo::foo() call itself?
dave hj~
In reply to inheritance weirdness by dash2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |