diff options
author | Perl 5 Porters <perl5-porters.nicoh.com> | 1996-01-01 23:10:38 +0000 |
---|---|---|
committer | Andy Dougherty <doughera.lafayette.edu> | 1996-01-01 23:10:38 +0000 |
commit | c1bce5d7c4f10bb970b094ec986540c244295278 (patch) | |
tree | c7442dbccb8a970a28f275d57919e11e152825f9 /lib/Carp.pm | |
parent | 5b930e62b086683d709a191483147bd1b22bc687 (diff) | |
download | perl-c1bce5d7c4f10bb970b094ec986540c244295278.tar.gz |
Honor trailing \n in messages, as is done for warn().
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r-- | lib/Carp.pm | 8 |
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; |