Bug#611854: Hash::Util::lock_hashref_recurse spews uninitialized value warnings

Anthony DeRobertis anthony at derobert.net
Wed Feb 2 21:11:51 UTC 2011


Package: perl-base
Version: 5.10.1-17
Severity: minor
File: /usr/lib/perl/5.10.1/Hash/Util.pm

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.

-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-trunk-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages perl-base depends on:
ii  dpkg                          1.15.8.10  Debian package management system
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib

perl-base recommends no packages.

Versions of packages perl-base suggests:
ii  perl                          5.10.1-17  Larry Wall's Practical Extraction 

-- no debconf information






More information about the Perl-maintainers mailing list