This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #37233] [PATCH] Test::Harness and Devel::Cover combine with overloading to...
authorYves Orton <demerphq@gmail.com>
Thu, 22 Sep 2005 11:31:02 +0000 (04:31 -0700)
committerSteve Peters <steve@fisharerojo.org>
Sun, 2 Oct 2005 12:50:02 +0000 (12:50 +0000)
From: perlbug-followup[at]perl.org (Yves Orton)
Message-ID: <rt-3.0.11-37233-121233.2.25543632691242[at]perl.org>

p4raw-id: //depot/perl@25679

lib/Carp/Heavy.pm

index 79aa5f8..f86b7b4 100644 (file)
@@ -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);