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.