From: Alex Gough Date: Thu, 8 Mar 2001 17:18:19 +0000 (+0000) Subject: Re: mission impossible for the day X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a57e0bb0403a797d32021f5aeec1a7881541f1e;p=p5sagit%2Fp5-mst-13.2.git Re: mission impossible for the day Message-ID: <3AA7BEDB.8070409@rcon.org> If references (are overloaded) and can be directly stringified, show that instead of "stringified". (The problem, infinite mutual recursion caused by overloaded bool in Switch.pm, tracked by David Mitchell) p4raw-id: //depot/perl@9085 --- diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index b551560..a3d951b 100644 --- a/lib/Carp/Heavy.pm +++ b/lib/Carp/Heavy.pm @@ -48,7 +48,7 @@ sub format_arg { $arg = 'undef'; } elsif (ref($arg)) { - $arg .= ''; # Make it a string; + $arg = defined($overload::VERSION) ? overload::StrVal($arg) : "$arg"; } $arg =~ s/'/\\'/g; $arg = str_len_trim($arg, $MaxLenArg);