develooper Front page | perl.perl5.porters | Postings from September 2010

Hash::Util::lock_hash_recurse throws warnings

Thread Next
Chas. Owens
September 16, 2010 07:36
Hash::Util::lock_hash_recurse throws warnings
Message ID:
For an example of the bug see

Here is a patch that fixes the warnings.  I did not include a test
because I don't know the canonical way to test for warnings (I know
how I do it, and it isn't pretty).

diff --git a/ext/Hash-Util/lib/Hash/ b/ext/Hash-Util/lib/Hash/
index 95da7d9..158a70e 100644
--- a/ext/Hash-Util/lib/Hash/
+++ b/ext/Hash-Util/lib/Hash/
@@ -321,7 +321,8 @@ sub lock_hashref_recurse {

     foreach my $value (values %$hash) {
-        if (reftype($value) eq 'HASH') {
+        my $type = reftype($value);
+        if (defined $type and $type eq 'HASH') {
diff --git a/pod/perl5135delta.pod b/pod/perl5135delta.pod
index c1b5bc7..ccd3645 100644
--- a/pod/perl5135delta.pod
+++ b/pod/perl5135delta.pod
@@ -139,6 +139,16 @@ XXX Description of the change here


+=head3 L<perlport>
+=over 4
+=item *
+fixed typo
 =head1 Diagnostics

 The following additions or changes have been made to diagnostic output,

Chas. Owens
The most important skill a programmer can have is the ability to read.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About