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: 5932
Status: resolved
Priority: 0/
Queue: CGI

Owner: Nobody in particular
Requestors: cpan [...]

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

Subject: Error string suppressed by CGI::Carp when $! is passed unquoted to die()
Hi, As from version 1.24 of CGI::Carp, it fails to print the error string to STDERR when the $! variable is passed unquoted to die(). Example: use CGI::Carp; $! = 5; die $!; CGI::Carp prints an error message without stating the reason, which in this case should have been: "Input/output error". This is what the beginning of the die() function in CGI::Carp currently looks like: sub die { my ($arg) = @_; realdie @_ if ineval; if (!ref($arg)) { $arg = join("", @_); After the call for ineval(), $_[0] contains the null string. I have located the reason for the behaviour to this line in the _longmess() function: my $message = Carp::longmess(); i.e. it is in the Carp module that something happens... Anyway, as a simple fix, I would suggest that the above lines from the die() function are replaced with: sub die { my ($arg) = @_; my @args = @_; realdie @args if ineval; if (!ref($arg)) { $arg = join("", @args); With the hope that you'll find this report useful. / Gunnar

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

Please report any issues with to