80b298
diff --git a/Changes b/Changes
80b298
index b55b49f..dca6a52 100644
80b298
--- a/Changes
80b298
+++ b/Changes
80b298
@@ -1,4 +1,12 @@
80b298
 
80b298
+version 1.40; 2016-03-10
80b298
+  * Get arg_string.t to compile in perl v5.6
80b298
+  * Add information for how to contribute to Carp.
80b298
+
80b298
+version 1.39; 2016-03-06
80b298
+  * bugfix: longmess() should return the error in scalar context
80b298
+  (CPANRT#107225)
80b298
+
80b298
 version 1.38; 2015-11-06
80b298
   * stable release of changes since v1.36
80b298
 
80b298
diff --git a/lib/Carp.pm b/lib/Carp.pm
80b298
index 9421c74..92f8866 100644
80b298
--- a/lib/Carp.pm
80b298
+++ b/lib/Carp.pm
80b298
@@ -87,7 +87,7 @@ BEGIN {
80b298
     }
80b298
 }
80b298
 
80b298
-our $VERSION = '1.38';
80b298
+our $VERSION = '1.40';
80b298
 $VERSION =~ tr/_//d;
80b298
 
80b298
 our $MaxEvalLen = 0;
80b298
@@ -445,7 +445,9 @@ sub long_error_loc {
80b298
 }
80b298
 
80b298
 sub longmess_heavy {
80b298
-    return @_ if ref( $_[0] );    # don't break references as exceptions
80b298
+    if ( ref( $_[0] ) ) {   # don't break references as exceptions
80b298
+        return wantarray ? @_ : $_[0];
80b298
+    }
80b298
     my $i = long_error_loc();
80b298
     return ret_backtrace( $i, @_ );
80b298
 }
80b298
@@ -906,6 +908,12 @@ call die() or warn(), as appropriate.
80b298
 L<Carp::Always>,
80b298
 L<Carp::Clan>
80b298
 
80b298
+=head1 CONTRIBUTING
80b298
+
80b298
+L<Carp> is maintained by the perl 5 porters as part of the core perl 5
80b298
+version control repository. Please see the L<perlhack> perldoc for how to
80b298
+submit patches and contribute to it.
80b298
+
80b298
 =head1 AUTHOR
80b298
 
80b298
 The Carp module first appeared in Larry Wall's perl 5.000 distribution.
80b298
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm
80b298
index 91a42d1..b05d758 100644
80b298
--- a/lib/Carp/Heavy.pm
80b298
+++ b/lib/Carp/Heavy.pm
80b298
@@ -2,7 +2,7 @@ package Carp::Heavy;
80b298
 
80b298
 use Carp ();
80b298
 
80b298
-our $VERSION = '1.38';
80b298
+our $VERSION = '1.40';
80b298
 $VERSION =~ tr/_//d;
80b298
 
80b298
 # Carp::Heavy was merged into Carp in version 1.12.  Any mismatched versions
80b298
diff --git a/t/Carp.t b/t/Carp.t
80b298
index a18e3b4..9ecdf88 100644
80b298
--- a/t/Carp.t
80b298
+++ b/t/Carp.t
80b298
@@ -3,7 +3,7 @@ no warnings "once";
80b298
 use Config;
80b298
 
80b298
 use IPC::Open3 1.0103 qw(open3);
80b298
-use Test::More tests => 65;
80b298
+use Test::More tests => 66;
80b298
 
80b298
 sub runperl {
80b298
     my(%args) = @_;
80b298
@@ -39,6 +39,24 @@ BEGIN {
80b298
   );
80b298
 }
80b298
 
80b298
+package MyClass;
80b298
+
80b298
+sub new { return bless +{ field => ['value1', 'SecondVal'] }; }
80b298
+
80b298
+package main;
80b298
+
80b298
+{
80b298
+    my $err = Carp::longmess(MyClass->new);
80b298
+
80b298
+    # See:
80b298
+    # https://rt.cpan.org/Public/Bug/Display.html?id=107225
80b298
+    is_deeply(
80b298
+        $err->{field},
80b298
+        ['value1', 'SecondVal',],
80b298
+        "longmess returns sth meaningful in scalar context when passed a ref.",
80b298
+    );
80b298
+}
80b298
+
80b298
 {
80b298
     local $SIG{__WARN__} = sub {
80b298
         like $_[0], qr/ok (\d+)\n at.+\b(?i:carp\.t) line \d+\.$/, 'ok 2\n';
80b298
diff --git a/t/arg_string.t b/t/arg_string.t
80b298
index 42b43b1..dbd2e6e 100644
80b298
--- a/t/arg_string.t
80b298
+++ b/t/arg_string.t
80b298
@@ -15,7 +15,7 @@ my $e9 = sprintf "%02x", (($] ge 5.007_003)
80b298
                           : ((ord("A") == 193)
80b298
                              ? 0x51
80b298
                              : 0xE9));
80b298
-my $chr_e9 = chr utf8::unicode_to_native(0xe9);
80b298
+my $chr_e9 = chr eval "0x$e9";
80b298
 my $nl_as_hex = sprintf "%x", ord("\n");
80b298
 
80b298
 like lm(3), qr/main::lm\(3\)/;