Re: Can't call NEXT::f from B::g
- From: Victor Porton <porton@xxxxxxxx>
- Date: Wed, 30 Jan 2008 07:51:26 -0800 (PST)
On 30 Jan, 16:47, Peter Makholm <pe...@xxxxxxxxxxx> wrote:
Victor Porton <por...@xxxxxxxx> writes:
$ perl test.pl
Can't call NEXT::f from B::g at /home/porton/t/test2.pl line 10
Why the error?
Doesn't the following except from the documentation to NEXT explains
it?
Note that it is a fatal error for any method (including "AUTOLOAD") to
attempt to redispatch any method that does not have the same name. For
example:
sub D::oops { print "oops!\n"; $_[0]->NEXT::other_method() }
Yes, that was my error.
New question: Why the below script does not print "123"?
#!/usr/bin/perl -w
use NEXT;
package A;
sub f { print "123\n" }
package B;
use base 'A';
package C;
use base 'B';
sub f { shift->NEXT::f }
C->f;
.
- References:
- Can't call NEXT::f from B::g
- From: Victor Porton
- Re: Can't call NEXT::f from B::g
- From: Peter Makholm
- Can't call NEXT::f from B::g
- Prev by Date: Re: Get an arbitrary hash key, quickly.
- Next by Date: Re: Get an arbitrary hash key, quickly.
- Previous by thread: Re: Can't call NEXT::f from B::g
- Index(es):
Relevant Pages
|