Skip to content

Commit

Permalink
Patch to CGI::Carp from Peter Whaite to fix the unfixable problem of …
Browse files Browse the repository at this point in the history
…CGI::Carp not behaving correctly in an eval() context.
  • Loading branch information
lstein committed Feb 17, 2006
1 parent 47790d0 commit 606fdf3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 15 additions & 1 deletion CGI/Carp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ non-overridden program name
=head1 CHANGE LOG
1.29 Patch from Peter Whaite to fix the unfixable problem of CGI::Carp
not behaving correctly in an eval() context.
1.05 carpout() added and minor corrections by Marc Hedlund
<hedlund@best.com> on 11/26/95.
Expand Down Expand Up @@ -384,7 +387,18 @@ sub ineval {

sub die {
my ($arg,@rest) = @_;
realdie ($arg,@rest) if ineval();

if ( ineval() ) {
if (!ref($arg)) {
$arg = join("",($arg,@rest)) || "Died";
my($file,$line,$id) = id(1);
$arg .= " at $file line $line.\n" unless $arg=~/\n$/;
realdie($arg);
}
else {
realdie($arg,@rest);
}
}

if (!ref($arg)) {
$arg = join("", ($arg,@rest));
Expand Down
4 changes: 3 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Version 3.17 ??
1. Added patch from Mike Hanafey which caused 0 arguments to CGI::Cookie->new() to
be treated as empty.
2. Patch to CGI::Carp from Peter Whaite to fix the unfixable problem of CGI::Carp
not behaving correctly in an eval() context.

Version 3.16 Tue Dec 27 13:54:19 EST 2005
Version 3.16 Wed Feb 8 13:29:11 EST 2006
1. header() -charset option now works even when the MIME type is not "text".
2. Fixed documentation for cookie() function and fastCGI.
3. Upload filehandles now only closed automatically on Windows systems.
Expand Down

0 comments on commit 606fdf3

Please sign in to comment.