From 8a7acfb9b07364b45423d76a5a3e8a6d629465ec Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Thu, 22 Sep 2005 04:31:02 -0700 Subject: [perl #37233] [PATCH] Test::Harness and Devel::Cover combine with overloading to cause infinite recursion in Carp.pm From: perlbug-followup[at]perl.org (Yves Orton) Message-ID: p4raw-id: //depot/perl@25679 --- lib/Carp/Heavy.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index 79aa5f8f9b..f86b7b4371 100644 --- a/lib/Carp/Heavy.pm +++ b/lib/Carp/Heavy.pm @@ -103,11 +103,10 @@ sub caller_info { # Transform an argument to a function into a string. sub format_arg { my $arg = shift; - if (not defined($arg)) { - $arg = 'undef'; - } - elsif (ref($arg)) { + if (ref($arg)) { $arg = defined($overload::VERSION) ? overload::StrVal($arg) : "$arg"; + }elsif (not defined($arg)) { + $arg = 'undef'; } $arg =~ s/'/\\'/g; $arg = str_len_trim($arg, $MaxArgLen); -- cgit v1.2.1