diff options
author | M.J.T. Guy <mjtg@cus.cam.ac.uk> | 1997-03-08 20:12:17 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-03-07 04:01:12 +1200 |
commit | d43563dda8f974d66e255d10af6e34c09bb46cb4 (patch) | |
tree | 4a44205e5473a63edad772f760aa8d904182c33c /lib/Carp.pm | |
parent | b4af43c9fb3ef14c4c948a3a34d31ef17ebc4eed (diff) | |
download | perl-d43563dda8f974d66e255d10af6e34c09bb46cb4.tar.gz |
Carp with multiple arguments
Subject: Carp with multiple arguments (and lack of tests)
carp/croak/confess are documented as similar to warn/die, but whereas
warn/die print multiple arguments, carp/croak/confess print only the
first. Assuming that this is a bug rather than a feature, the following
patch corrects it. (And if it _is_ a feature, the pod needs updating
instead, to explain it away.)
Trying to be polite, I thought I'd update the Carp tests to cover this
case. But I couldn't find any Carp tests ... I'll have a go
at rectifying this lacuna. But not till tomorrow.
p5p-msgid: E0w3STZ-0007RW-00@taurus.cus.cam.ac.uk
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r-- | lib/Carp.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm index de586489ba..ec08d30c19 100644 --- a/lib/Carp.pm +++ b/lib/Carp.pm @@ -37,7 +37,7 @@ require Exporter; @EXPORT = qw(confess croak carp); sub longmess { - my $error = shift; + my $error = join '', @_; my $mess = ""; my $i = 1 + $CarpLevel; my ($pack,$file,$line,$sub,$hargs,$eval,$require); @@ -85,7 +85,7 @@ sub longmess { } sub shortmess { # Short-circuit &longmess if called via multiple packages - my $error = $_[0]; # Instead of "shift" + my $error = join '', @_; my ($prevpack) = caller(1); my $extra = $CarpLevel; my $i = 2; |