summaryrefslogtreecommitdiff
path: root/warnings.pl
diff options
context:
space:
mode:
authorAnno Siegel <anno4000@lublin.zrz.tu-berlin.de>2003-08-31 22:08:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-09-10 21:18:59 +0000
commit4f527b719ae8907622f7dc49e1c381136e69bb59 (patch)
treed814ae69be947ba0fff011ff14e130fc51910477 /warnings.pl
parent788611b6a6a160290f10302fc348e5dff91edc6e (diff)
downloadperl-4f527b719ae8907622f7dc49e1c381136e69bb59.tar.gz
Re: [perl #15395] lexical warnings and inheritance
Message-Id: <200308312208.WAA25312@lublin.zrz.TU-Berlin.DE> The test has been moved into warnings.pm's test suite. Note that this patch fixed as well the behaviour of warnings::enabled regarding lexical scoping and different files; hence the expected results in a few tests in /t/lib/warnings/9enabled has been reverted. p4raw-id: //depot/perl@21167
Diffstat (limited to 'warnings.pl')
-rw-r--r--warnings.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/warnings.pl b/warnings.pl
index 61779528ec..7feccb5751 100644
--- a/warnings.pl
+++ b/warnings.pl
@@ -747,17 +747,18 @@ sub __chk
$i -= 2 ;
}
else {
- for ($i = 2 ; $pkg = (caller($i))[0] ; ++ $i) {
- last if $pkg ne $this_pkg ;
- }
- $i = 2
- if !$pkg || $pkg eq $this_pkg ;
+ $i = _error_loc(); # see where Carp will allocate the error
}
my $callers_bitmask = (caller($i))[9] ;
return ($callers_bitmask, $offset, $i) ;
}
+sub _error_loc {
+ require Carp::Heavy;
+ goto &Carp::short_error_loc; # don't introduce another stack frame
+}
+
sub enabled
{
Croaker("Usage: warnings::enabled([category])")