Bug#611854: [perl #83262] Hash::Util::lock_hashref_recurse spews uninitialized value warnings

Father Chrysostomos via RT perlbug-followup at perl.org
Sun Feb 6 21:09:04 UTC 2011


On Wed Feb 02 13:58:23 2011, aderobertis at metrics.net wrote:
> Hash::Util has a 'use warnings' up top, which unconditionally enables
> warnings in the module. However, it then does things like:
> 
> 	sub lock_hashref_recurse {
> 		my $hash = shift;
> 
> 		lock_ref_keys($hash);
> 		foreach my $value (values %$hash) {
> 			if (reftype($value) eq 'HASH') { #<---- HERE
> 				lock_hashref_recurse($value);
> 			}
> 			Internals::SvREADONLY($value,1);
> 		}
> 		return $hash
> 	}
> 
> Scalar::Util::reftype, however, returns undef if the value is not a
> reference, leading to spewing a warning per non-reference value.
>    That's
> a lot of spewage!
> 
> There are two occurances I see upon a quick glance: once in lock and
> once in unlock. Both need to be protected or probably just have:
> 	no warnings 'uninitialized'
> added.

Thank you for the report. This was fixed early on in the 5.13.x series.







More information about the Perl-maintainers mailing list