diff options
author | Dave Rolsky <autarch@urth.org> | 2004-07-09 12:06:07 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-07-10 13:03:56 +0000 |
commit | 874ad44d852a3d0f27f985a25ac70c3cde24a259 (patch) | |
tree | 0d0b274dbe7ada983da61113d550db2a98645349 /lib/NEXT.pm | |
parent | 078c425b721ea35d568a7ec980e3b95d036a25c3 (diff) | |
download | perl-874ad44d852a3d0f27f985a25ac70c3cde24a259.tar.gz |
Bug with NEXT when called from an eval block
Message-ID: <Pine.LNX.4.58.0407091703010.4578@urth.org>
p4raw-id: //depot/perl@23075
Diffstat (limited to 'lib/NEXT.pm')
-rw-r--r-- | lib/NEXT.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/NEXT.pm b/lib/NEXT.pm index 64610fed27..1c6a316fff 100644 --- a/lib/NEXT.pm +++ b/lib/NEXT.pm @@ -1,5 +1,5 @@ package NEXT; -$VERSION = '0.60'; +$VERSION = '0.60_01'; use Carp; use strict; @@ -32,7 +32,9 @@ sub NEXT::ELSEWHERE::ordered_ancestors 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; @@ -94,7 +96,9 @@ package EVERY; @ISA = 'NEXT'; 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; |