Re: Can't call NEXT::f from B::g



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;
.



Relevant Pages

  • gcc2.95.2 errors during compiling
    ... It would be very useful for me to install a precompiled package ... *** Error code 1 ... make: Fatal error: Command failed for target `cc1chill' ...
    (comp.unix.solaris)
  • Re: gcc2.95.2 errors during compiling
    ... compiling. ... It would be very useful for me to install a precompiled package ... make: Fatal error: Command failed for target `cc1chill' ...
    (comp.unix.solaris)
  • DTS Referece Problem
    ... so for that i creatd the DTS Package and save as visual basic module and then from vb i'll exuectue the package. ... when try to open the sql server i got this error. ... Fatal error: ...
    (microsoft.public.vb.general.discussion)
  • GD Install - Apache, Win XP
    ... I downloaded PHP 5.1.2 zip package from ... I've de-commented the include DLL - php_gd2.dl in php.ini but it is ... Fatal error: Call to undefined function ImageCreatein C:\Program ...
    (php.general)
  • GD Install - Apache, Win XP
    ... I downloaded PHP 5.1.2 zip package from ... I've de-commented the include DLL - php_gd2.dl in php.ini but it is ... Fatal error: Call to undefined function ImageCreatein C:\Program ...
    (php.general)