summaryrefslogtreecommitdiff
path: root/lib/CGI/Carp.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-06-28 18:22:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-06-28 18:22:26 +0000
commit3538e1d594b84483ebd9da2f46446c3f5afac4b5 (patch)
tree4c552ec41f79d987d4828e56d361490a47ebcf96 /lib/CGI/Carp.pm
parentf7f713ed45383cfc8868c7c7e610ab988a7e0815 (diff)
downloadperl-3538e1d594b84483ebd9da2f46446c3f5afac4b5.tar.gz
upgrade CGI.pm to v2.53 (CGI/{Apache,Switch}.pm NOT deleted)
p4raw-id: //depot/perl@3559
Diffstat (limited to 'lib/CGI/Carp.pm')
-rw-r--r--lib/CGI/Carp.pm26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/CGI/Carp.pm b/lib/CGI/Carp.pm
index dfae1a61b7..8425fa0686 100644
--- a/lib/CGI/Carp.pm
+++ b/lib/CGI/Carp.pm
@@ -192,9 +192,16 @@ use Carp;
@EXPORT = qw(confess croak carp);
@EXPORT_OK = qw(carpout fatalsToBrowser wrap set_message cluck);
+BEGIN {
+ $] >= 5.005
+ ? eval q#sub ineval { $^S }#
+ : eval q#sub ineval { _longmess() =~ /eval [\{\']/m }#;
+ $@ and die;
+}
+
$main::SIG{__WARN__}=\&CGI::Carp::warn;
$main::SIG{__DIE__}=\&CGI::Carp::die;
-$CGI::Carp::VERSION = '1.13';
+$CGI::Carp::VERSION = '1.14';
$CGI::Carp::CUSTOM_MSG = undef;
# fancy import routine detects and handles 'errorWrap' specially.
@@ -251,14 +258,15 @@ sub _longmess {
}
sub die {
- my $message = shift;
- my $time = scalar(localtime);
- my($file,$line,$id) = id(1);
- $message .= " at $file line $line." unless $message=~/\n$/;
- &fatalsToBrowser($message) if $WRAP && _longmess() !~ /eval [{\']/m;
- my $stamp = stamp;
- $message=~s/^/$stamp/gm;
- realdie $message;
+ realdie @_ if ineval;
+ my $message = shift;
+ my $time = scalar(localtime);
+ my($file,$line,$id) = id(1);
+ $message .= " at $file line $line." unless $message=~/\n$/;
+ &fatalsToBrowser($message) if $WRAP;
+ my $stamp = stamp;
+ $message=~s/^/$stamp/gm;
+ realdie $message;
}
sub set_message {