Subject: | Future-proof HTML-Tagset for strictures and warnings |
In future versions of perl, it is highly likely that 'use strict;' and 'use warnings' will be on by default. When that happens, code in existing CPAN distributions that is not fully compliant will either start to throw warnings or will suffer compile-time or run-time failures.
The patches attached to this ticket should resolve that problem for HTML-Tagset. They provide the minimum adaptations needed for such a future environment. They have been tested on both perl-5.32.0 and on an experimental version of perl-7.0.0, with no test failures and no warnings emitted on either.
Please review and, if acceptable, issue a new CPAN release. (Should you wish to establish a GitHub repository for this codebase, please do so and I will provide a pull request.)
Thank you very much.
Jim Keenan
Subject: | 0001-Adapt-tests-to-strictures-and-warnings.patch |
From ff743073f9b4c2213eefec343861da43ed4f128a Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Mon, 20 Jul 2020 16:40:19 -0400
Subject: [PATCH] Adapt tests to strictures and warnings
Although the test files do not call for being run with either strictures
and warnings on, future Perl versions may have those on by default.
This commit provides a minimal set of changes to adapt to that
situation.
---
t/00_about_verbose.t | 3 ++-
t/01_old_junk.t | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/00_about_verbose.t b/t/00_about_verbose.t
index 3278b58..6029d85 100644
--- a/t/00_about_verbose.t
+++ b/t/00_about_verbose.t
@@ -31,6 +31,7 @@ use HTML::Tagset ();
my $count = 0;
my $pref;
while(@stack) {
+ no strict 'refs';
$this = shift @stack;
die "Too many packages?" if ++$count > 1000;
next if exists $v{$this};
@@ -59,7 +60,7 @@ use HTML::Tagset ();
push @out, " Modules in memory:\n";
delete @v{'', '[none]'};
foreach my $p (sort {lc($a) cmp lc($b)} keys %v) {
- $indent = ' ' x (2 + ($p =~ tr/:/:/));
+ my $indent = ' ' x (2 + ($p =~ tr/:/:/));
push @out, ' ', $indent, $p, defined($v{$p}) ? " v$v{$p};\n" : ";\n";
}
push @out, sprintf "[at %s (local) / %s (GMT)]\n",
diff --git a/t/01_old_junk.t b/t/01_old_junk.t
index a09080f..bad8329 100644
--- a/t/01_old_junk.t
+++ b/t/01_old_junk.t
@@ -1,6 +1,7 @@
# Time-stamp: "2004-12-29 18:49:45 AST"
+my $loaded;
BEGIN { $| = 1; print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
use HTML::Tagset;
--
2.17.1