Skip Menu |
 

This queue is for tickets about the Carp-Always CPAN distribution.

Report information
The Basics
Id: 75825
Status: open
Priority: 0/
Queue: Carp-Always

People
Owner: Nobody in particular
Requestors: n [...] shaplov.ru
Cc: ether [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Carp::Always + strict => stict works wrong
Date: Fri, 16 Mar 2012 22:47:44 +0400
To: bug-Carp-Always [...] rt.cpan.org
From: Nikolay Shaplov <n [...] shaplov.ru>
Download (untitled) / with headers
text/plain 639b
When you use both Carp::Always and strict, strict stops properly detect the line number of not declared variables: ===================== #!/usr/bin/perl use strict; use Carp::Always; $z=1; print "the end\n"; ==================== This script will say Global symbol "$z" requires explicit package name at ./carp.pl line 16 through $z is mentioned at line 5. If you comment out use Carp::Always, strict will work properly and say about line 5 as it should. I do not think there can be an error in strict, error in Carp::Always is more probable in my opinion. If not, tell me, I will report this to strict maintainers :-)
On Fri Mar 16 14:48:53 2012, Shaplov wrote: Show quoted text
> > When you use both Carp::Always and strict, strict stops properly > detect the > line number of not declared variables: > ===================== > #!/usr/bin/perl > > use strict; > use Carp::Always; > $z=1; > > > > > > > > > > > print "the end\n"; > ==================== > This script will say > > Global symbol "$z" requires explicit package name at ./carp.pl line 16 > > through $z is mentioned at line 5. > > If you comment out use Carp::Always, strict will work properly and say > about > line 5 as it should. > > I do not think there can be an error in strict, error in Carp::Always > is more > probable in my opinion. If not, tell me, I will report this to strict > maintainers :-) >
I think this is a bug in perl, because caller() inside a $SIG{__DIE__} handler is returning the wrong line number. But I don’t understand why Carp::Always has to remove the line number passed in to the handler via the message in $_[0]. So maybe it’s a bug in both.
Download (untitled) / with headers
text/plain 289b
On Fri Mar 16 17:20:02 2012, SPROUT wrote: Show quoted text
> I think this is a bug in perl, because caller() inside a $SIG{__DIE__} > handler is returning the > wrong line number.
Actually, I don’t think it is. See my reasoning at <https://rt.perl.org/rt3/Ticket/Display.html? id=111982#txn-1109292>.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.