From: Perl 5 Porters Date: Mon, 1 Jan 1996 23:10:38 +0000 (+0000) Subject: Honor trailing \n in messages, as is done for warn(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1bce5d7c4f10bb970b094ec986540c244295278;p=p5sagit%2Fp5-mst-13.2.git Honor trailing \n in messages, as is done for warn(). --- diff --git a/lib/Carp.pm b/lib/Carp.pm index ba21d9c..2d857ba 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;