summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;