On Wed Feb 26 04:28:12 2020, RURBAN wrote:
Show quoted text> On Wed Feb 26 03:25:51 2020, RURBAN wrote:
> > The problem is at the static end-time hook, when $INC{Opcodes.pm} is
> > empty because it was cleared. Interesting.
>
> Seems to be a 5.31.9 regression in perl5.
> At the END hook the previously loaded module Opcodes
> has an empty %INC entry and it's functions are defined but empty.
>
> I added some workarounds, but the dynamic run-time profiler does not
> work anymore.
> See the smoke branch on github
The code that modifies %INC is here:
https://metacpan.org/source/RURBAN/B-Stats-0.09/lib/B/Stats.pm#L310
my $inc = $key eq 'c' ? \%B_inc : \%INC;
my $files = scalar keys %$inc;
for (values %$inc) { # $_ is an alias to $INC{...}
print $LOG $_,"\n" if $opt{F};
open IN, "<", "$_";
# Todo: skip pod?
while (<IN>) { chomp; s/#.*//; next if not length $_; $lines++; }; # modify $INC{...}
close IN;
}
changing this to:
for my $file (values %$inc) {
print $LOG $file,"\n" if $opt{F};
open IN, "<", "$file";
# Todo: skip pod?
while (<IN>) { chomp; s/#.*//; next if not length $_; $lines++; };
close IN;
}
fixes the problem.
It only worked before because of the bug that 4b004c43ef26ce17 fixed.