Skip Menu |

This queue is for tickets about the IO-Capture CPAN distribution.

Report information
The Basics
Id: 133027
Status: new
Priority: 0/
Queue: IO-Capture

People
Owner: Nobody in particular
Requestors: jkeenan [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Future-proof IO-Capture: eliminate warnings emitted when run with 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 IO-Capture. 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 release.) I am very interested in this, as I have CPAN distributions which, since the early 2000s, have relied on IO-Capture for testing functionality. Thank you very much. Jim Keenan
Subject: 0001-Future-proof-Makefile.PL.patch
From 29c21ddc33bac1439ace2fe24df827559cabfafb Mon Sep 17 00:00:00 2001 From: James E Keenan <jkeenan@cpan.org> Date: Mon, 20 Jul 2020 11:33:29 -0400 Subject: [PATCH 1/3] Future-proof Makefile.PL Left-hand side of '=>' needs to be quoted when strict 'subs' is in effect. --- Makefile.PL | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index 9ff83d9..000fe0a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,10 +1,12 @@ use 5.006; use ExtUtils::MakeMaker; +use strict; +use warnings; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'IO::Capture', VERSION_FROM => 'lib/IO/Capture.pm', # finds $VERSION - PREREQ_PM => {Carp => 0, Test::More => 0}, + PREREQ_PM => {Carp => 0, "Test::More" => 0}, ); -- 2.17.1
Subject: 0002-t-02_1_basic_base.t-Avoid-uninitialized-value-warnin.patch
From 9f1c00eae431918733673af3bcdeaddbfbd728a9 Mon Sep 17 00:00:00 2001 From: James E Keenan <jkeenan@cpan.org> Date: Mon, 20 Jul 2020 11:41:21 -0400 Subject: [PATCH 2/3] t/02_1_basic_base.t: Avoid uninitialized value warnings Each side of string equality comparison must be initialized to avoid this warning when warnings are in effect. --- t/02_1_basic_base.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/02_1_basic_base.t b/t/02_1_basic_base.t index c759834..f2aca08 100644 --- a/t/02_1_basic_base.t +++ b/t/02_1_basic_base.t @@ -57,6 +57,6 @@ ok ($initial_stderr_inum == $ending_stderr_inum, "Invariant Check - STDERR inode ######################################################### #Test 9 -my $test_result_9 = $SIG{__WARN__} eq $warn_save; +my $test_result_9 = ($SIG{__WARN__} || '') eq ($warn_save || ''); ok ($test_result_9, "Invariant Check - __WARN__"); print "\n" . "*"x60 . "\n__WARN__ did not get restored correctly in $0\n" . "*"x60 . "\n\n" unless $test_result_9; -- 2.17.1
Subject: 0003-t-02_3_basic_Stderr.t-Avoid-uninitialized-value-warn.patch
From 548647d8c4d57e6f690779e1b7ccbd150889e91c Mon Sep 17 00:00:00 2001 From: James E Keenan <jkeenan@cpan.org> Date: Mon, 20 Jul 2020 11:43:44 -0400 Subject: [PATCH 3/3] t/02_3_basic_Stderr.t: Avoid uninitialized value warnings Each side of string equality comparison must be initialized to avoid this warning when warnings are in effect. --- t/02_3_basic_Stderr.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/02_3_basic_Stderr.t b/t/02_3_basic_Stderr.t index 3eaec8b..f87d740 100644 --- a/t/02_3_basic_Stderr.t +++ b/t/02_3_basic_Stderr.t @@ -89,7 +89,7 @@ ok ($initial_stderr_inum == $ending_stderr_inum, "Invariant Check - STDERR inode #Test 13 # make sure $SIG{__WARN__} is not set. I.e., It was not left in an odd state -cmp_ok ( $SIG{__WARN__}, 'eq', '', "warn back to DEFAULT"); +cmp_ok ( ($SIG{__WARN__} || ''), 'eq', '', "warn back to DEFAULT"); #Test 14 my $warn_handler = sub {print STDERR "Custom warn handler in effect\n"}; -- 2.17.1