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