summaryrefslogtreecommitdiff
path: root/lib/Carp.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
commit6ff81951f79dec32e15a779d288c1047f0e4fefb (patch)
tree53c645778f7a018e0bd74a2ec2fe9c64833ea13d /lib/Carp.pm
parent48c036b1eb8f866b948f33704ee6152323a5aad9 (diff)
downloadperl-6ff81951f79dec32e15a779d288c1047f0e4fefb.tar.gz
[win32] merge changes#906,907,909,910 from maintbranch
p4raw-link: @910 on //depot/maint-5.004/perl: ae941ac0da8f453f0d31df7b7293e50b3e5a46f1 p4raw-link: @909 on //depot/maint-5.004/perl: 8b3d696ffd11cf2e49f6eaa575b829ab0a55352d p4raw-link: @907 on //depot/maint-5.004/perl: 3cb3c1abada5765ba4166ebe59e2e20d737ec21b p4raw-link: @906 on //depot/maint-5.004/perl: ae389c8a29b487f4434c465442dfb611507a4a38 p4raw-id: //depot/win32/perl@977
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r--lib/Carp.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index 6397d1b999..6bac36446a 100644
--- a/lib/Carp.pm
+++ b/lib/Carp.pm
@@ -60,6 +60,7 @@ $CarpLevel = 0; # How many extra package levels to skip on carp.
$MaxEvalLen = 0; # How much eval '...text...' to show. 0 = all.
$MaxArgLen = 64; # How much of each argument to print. 0 = all.
$MaxArgNums = 8; # How many arguments to print. 0 = all.
+$Verbose = 0; # If true then make shortmess call longmess instead
require Exporter;
@ISA = ('Exporter');
@@ -75,11 +76,7 @@ require Exporter;
sub export_fail {
shift;
- if ($_[0] eq 'verbose') {
- local $^W = 0; # avoid "sub-routine redefined..." warning
- *shortmess = \&longmess; # set shortmess() as an alias to longmess()
- shift; # remove 'verbose' from the args to keep Exporter happy
- }
+ $Verbose = shift if $_[0] eq 'verbose';
return @_;
}
@@ -188,10 +185,11 @@ sub longmess {
# shortmess() is called by carp() and croak() to skip all the way up to
# the top-level caller's package and report the error from there. confess()
# and cluck() generate a full stack trace so they call longmess() to
-# generate that. In verbose mode shortmess() is aliased to longmess() so
+# generate that. In verbose mode shortmess() calls longmess() so
# you always get a stack trace
sub shortmess { # Short-circuit &longmess if called via multiple packages
+ goto &longmess if $Verbose;
my $error = join '', @_;
my ($prevpack) = caller(1);
my $extra = $CarpLevel;