J Krugman: Before I go off an file a bug report, I want to make sure that I got things right. In the SYNOPSIS section for Damian Conway's NEXT module's POD, there's the following extended example:
use NEXT; package A; sub A::method { print "$_[0]: A method\n"; $_[0]->NEXT::method() } sub A::DESTROY { print "$_[0]: A dtor\n"; $_[0]->NEXT::DESTROY() } package B; use base qw( A ); sub B::AUTOLOAD { print "$_[0]: B AUTOLOAD\n"; $_[0]->NEXT::AUTOLOAD() } sub B::DESTROY { print "$_[0]: B dtor\n"; $_[0]->NEXT::DESTROY() } package C; sub C::method { print "$_[0]: C method\n"; $_[0]->NEXT::method() } sub C::AUTOLOAD { print "$_[0]: C AUTOLOAD\n"; $_[0]->NEXT::AUTOLOAD() } sub C::DESTROY { print "$_[0]: C dtor\n"; $_[0]->NEXT::DESTROY() } package D; use base qw( B C ); sub D::method { print "$_[0]: D method\n"; $_[0]->NEXT::method() } sub D::AUTOLOAD { print "$_[0]: D AUTOLOAD\n"; $_[0]->NEXT::AUTOLOAD() } sub D::DESTROY { print "$_[0]: D dtor\n"; $_[0]->NEXT::DESTROY() } package main; my $obj = bless {}, "D"; $obj->method(); # Calls D::method, A::method, C::method $obj->missing_method(); # Calls D::AUTOLOAD, B::AUTOLOAD, C::AUTOLO +AD # Clean-up calls D::DESTROY, B::DESTROY, A::DESTROY, C::DESTROY
Contrary to what the comments above say, when I run this example, the output that I get is:
D=HASH(0x8118164): D method D=HASH(0x8118164): C method D=HASH(0x8118164): D AUTOLOAD D=HASH(0x8118164): B AUTOLOAD D=HASH(0x8118164): C AUTOLOAD D=HASH(0x8118164): D dtor D=HASH(0x8118164): B dtor D=HASH(0x8118164): C dtor
(snip additional question from original c.l.p.mod. posting)
What's the story? Is NEXT really as broken as it looks, or am I missing something? My version of Perl is 5.8.4 and my version of NEXT is 0.60 (the latest one available from CPAN). (-- end J Krugman)
Any thoughts? Thanks.
Jim Keenan
In reply to Is Conway's NEXT.pm broken? by jkeenan1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |