Subject: | Bug exposed by latest perl |
Devel::Required fails its tests with the latest dev release of perl. I believe the fix should be simply to replace "caller()" with "caller(2)" in Required.pm.
Perl's caller() has long had a bug in the reporting of stack frames for BEGIN blocks. This is fixed in the latest bleadperl, scheduled to become 5.32; unfortunately that affects the mechanism used by Devel::Required to find the calling package.
In particular, caller() as used in Devel/Required.pm refers to the stack frame for its own BEGIN block; that has now changed to correctly report the package for that stack frame as Devel::Required.
The upshot is that for perl-5.31.10 and later, Devel::Required will find the wrong package to inject its WriteMakefile method into, because it is looking at the stack frame of its own BEGIN block.
Please see https://github.com/Perl/perl5/issues/17681 as well as .../15109 and .../17567.
Cheers,
Hugo van der Sanden