Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 84767
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: olig9 [...] gmx.de
Cc:
AdminCc:

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



Subject: CGI::Carp doesn't print Input Line Number in die() error message
Date: Sat, 20 Apr 2013 15:26:25 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: Oliver Gerlich <olig9 [...] gmx.de>
Hello, thanks for the great CGI module, which is really helpful! However, I've found a minor problem when using die() while CGI::Carp is enabled, and hope that this is the right place to ask. When die() is called, the error message created by CGI::Carp will not include the Input Line Number ($.), while the error message with CGI::Carp disabled does include this information. Some example code is attached. If CGI::Carp is used, the error message from die-test.pl will be: [Sat Apr 20 13:09:25 2013] die-test.pl: error at die-test.pl line 11. If CGI::Carp is not used, the error message will be: error at die-test.pl line 16, <IN> line 4. The "<IN> line 4." part is what I'm looking for. It would be useful to have this appear in the server log together with the error message. Btw. if Perl exits due to some other error, the message created by CGI::Carp does contain the input line number, eg.: Use of uninitialized value $undefVar in print at die-test.pl line 14, <IN> line 4. This happens with Perl 5.14.2 (from perl 5.14.2-6ubuntu2.3 package) under Ubuntu 12.04.2 32-bit. Thanks a lot, Oliver Gerlich

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #84767] CGI::Carp doesn't print Input Line Number in die() error message
Date: Mon, 22 Apr 2013 09:47:05 -0400
To: bug-CGI.pm [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
I would be open to this improvement, but I'm not sure how to do it. Patch welcome. Mark
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/115 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
CGI::Carp::die already seems to include the line number. I've added a test to verify this (t/rt-84767.t). If you can modify this test to show otherwise i would be interested. For now, closing.