package NEXT;
-$VERSION = '0.60';
+$VERSION = '0.60_01';
use Carp;
use strict;
sub AUTOLOAD
{
my ($self) = @_;
- my $caller = (caller(1))[3];
+ my $depth = 1;
+ until ((caller($depth))[3] !~ /^\(eval\)$/) { $depth++ }
+ my $caller = (caller($depth))[3];
my $wanted = $NEXT::AUTOLOAD || 'NEXT::AUTOLOAD';
undef $NEXT::AUTOLOAD;
my ($caller_class, $caller_method) = $caller =~ m{(.*)::(.*)}g;
sub AUTOLOAD
{
my ($self) = @_;
- my $caller = (caller(1))[3];
+ my $depth = 1;
+ until ((caller($depth))[3] !~ /^\(eval\)$/) { $depth++ }
+ my $caller = (caller($depth))[3];
my $wanted = $EVERY::AUTOLOAD || 'EVERY::AUTOLOAD';
undef $EVERY::AUTOLOAD;
my ($wanted_class, $wanted_method) = $wanted =~ m{(.*)::(.*)}g;
=head1 DESCRIPTION
NEXT.pm adds a pseudoclass named C<NEXT> to any program
-that uses it. If a method C<m> calls C<$self->NEXT::m()>, the call to
+that uses it. If a method C<m> calls C<$self-E<gt>NEXT::m()>, the call to
C<m> is redispatched as if the calling method had not originally been found.
-In other words, a call to C<$self->NEXT::m()> resumes the depth-first,
+In other words, a call to C<$self-E<gt>NEXT::m()> resumes the depth-first,
left-to-right search of C<$self>'s class hierarchy that resulted in the
original call to C<m>.
-Note that this is not the same thing as C<$self->SUPER::m()>, which
+Note that this is not the same thing as C<$self-E<gt>SUPER::m()>, which
begins a new dispatch that is restricted to searching the ancestors
-of the current class. C<$self->NEXT::m()> can backtrack
+of the current class. C<$self-E<gt>NEXT::m()> can backtrack
past the current class -- to look for a suitable method in other
-ancestors of C<$self> -- whereas C<$self->SUPER::m()> cannot.
+ancestors of C<$self> -- whereas C<$self-E<gt>SUPER::m()> cannot.
A typical use would be in the destructors of a class hierarchy,
as illustrated in the synopsis above. Each class in the hierarchy