Subject: | Silence Warnings under 5.8.8 |
Date: | Wed, 22 Feb 2006 09:08:14 -0800 |
To: | bug-sub-uplevel [...] rt.cpan.org |
From: | David E. Wheeler <david [...] kineticode.com> |
Heya Schwern,
I get these warnings from Sub::Uplevel under Perl 5.8.8:
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/die_check....ok
t/Uplevel......ok 1/18Use of uninitialized value in string eq at /
Users/david/Desktop/Sub-Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
Use of uninitialized value in string eq at /Users/david/Desktop/Sub-
Uplevel-0.09/blib/lib/Sub/Uplevel.pm line 123.
t/Uplevel......ok
All tests successful.
Files=2, Tests=19, 0 wallclock secs ( 0.10 cusr + 0.06 csys = 0.16
CPU)
I think that this patch should fix it:
--- lib/Sub/Uplevel.pm.old 2006-02-09 17:19:27.000000000 -0800
+++ lib/Sub/Uplevel.pm 2006-02-09 17:22:55.000000000 -0800
@@ -119,6 +119,7 @@
my $saw_uplevel = 0;
# Yes, we need a C style for loop here since $height changes
for( my $up = 1; $up <= $height + 1; $up++ ) {
+ no warnings 'uninitialized';
my @caller = CORE::caller($up);
if( $caller[0] eq __PACKAGE__ ) {
$height++;
I *think* that's okay on 5.6.0.
Cheers,
David