summaryrefslogtreecommitdiff
path: root/lib/Carp.pm
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters.nicoh.com>1996-01-01 23:10:38 +0000
committerAndy Dougherty <doughera.lafayette.edu>1996-01-01 23:10:38 +0000
commitc1bce5d7c4f10bb970b094ec986540c244295278 (patch)
treec7442dbccb8a970a28f275d57919e11e152825f9 /lib/Carp.pm
parent5b930e62b086683d709a191483147bd1b22bc687 (diff)
downloadperl-c1bce5d7c4f10bb970b094ec986540c244295278.tar.gz
Honor trailing \n in messages, as is done for warn().
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r--lib/Carp.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index ba21d9c625..2d857ba4e7 100644
--- a/lib/Carp.pm
+++ b/lib/Carp.pm
@@ -39,8 +39,12 @@ sub longmess {
my $i = 1 + $CarpLevel;
my ($pack,$file,$line,$sub);
while (($pack,$file,$line,$sub) = caller($i++)) {
- $mess .= "\t$sub " if $error eq "called";
- $mess .= "$error at $file line $line\n";
+ if ($error =~ m/\n$/) {
+ $mess .= $error;
+ } else {
+ $mess .= "\t$sub " if $error eq "called";
+ $mess .= "$error at $file line $line\n";
+ }
$error = "called";
}
$mess || $error;