Skip Menu |

This queue is for tickets about the constant-tiny CPAN distribution.

Report information
The Basics
Id: 131757
Status: open
Priority: 0/
Queue: constant-tiny

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

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



Subject: Bleadperl v5.31.8-52-g4b004c43ef breaks SAPER/constant-tiny-1.02.tar.gz
As per subject. That's the same commit as identified to break Modern::Perl in https://github.com/Perl/perl5/issues/17501
Dne St 12.úno.2020 05:43:19, ANDK napsal(a): Show quoted text
> As per subject. That's the same commit as identified to break > Modern::Perl in https://github.com/Perl/perl5/issues/17501
That commit revealed an old bug in constant::tiny. A fix is attached.
Subject: constant-tiny-1.02-Fix-injecting-INC-constant.pm.patch
From e4c31b052f9014875ee873bcb7959b343590fb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 26 Jun 2020 11:15:23 +0200 Subject: [PATCH] Fix injecting $INC{'constant.pm'} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perl 5.32 revealed that "use constant::tiny" injected an undefined value to $INC{'constant.pm'}. $ perl -Ilib -e 'use constant::tiny; use constant;' Attempt to reload constant.pm aborted. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. That's becaue Perl 5.32 started treat an undef value differently and refuses reloaded once failed module. A diagnostics explanation: (F) You tried to load a file with use or require that failed to compile once already. Perl will not try to compile this file again unless you delete its entry from %INC. See "require" in perlfunc and "%INC" in perlvar. This patch fixes setting the $INC{'constant.pm'} value. Signed-off-by: Petr Písař <ppisar@redhat.com> --- lib/constant/tiny.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/constant/tiny.pm b/lib/constant/tiny.pm index e8937b4..d5519d6 100644 --- a/lib/constant/tiny.pm +++ b/lib/constant/tiny.pm @@ -1,6 +1,6 @@ package constant::tiny; return 1 if $INC{"constant.pm"}; -$INC{"constant.pm"} = $INC{+__FILE__}; +$INC{"constant.pm"} = $INC{'constant/tiny.pm'}; $VERSION = "1.02"; package # hide from PAUSE -- 2.25.4