On 01/11/2019 06.17, Felix Lechner wrote:
> I did not intentionally use features of newer Perls, but it's possible
> that it plays a role.

Found it:
https://perldoc.perl.org/perl5260delta.html#scalar(%25hash)-return-signature-changed

stretch$ perl -e '%a = (1,2,3); print scalar %a, " -- ", scalar keys %a, "\n";'
2/8 -- 2

buster$ perl -e '%a = (1,2,3); print scalar %a, " -- ", scalar keys %a, "\n";'
2 -- 2

Some documentation of the old behavior:
https://www.perlmonks.org/?node=perldata
"If you evaluate a hash in a scalar context, it returns a value that is true if 
and only if the hash contains any key/value pairs. (If there are any key/value 
pairs, the value returned is a string consisting of the number of used buckets 
and the number of allocated buckets, separated by a slash. ..."


A backwards compatible solution should be the use of "scalar keys %hash"
(which also occurs about a dozen times in the code).
I only found two obvious occurrences of "scalar %hash" in current git master:

./lib/Lintian/DepMap.pm:162:    unless ($parents || scalar 
%{$self->{'nodes'}{$node}{'parents'}}) {
./lib/Lintian/Processable/Pool.pm:347:    return scalar %{$self->groups} == 0;

Andreas

PS: backporting coreutils 8.30 to stretch locally was a trivial no-change 
rebuild
PPS: I'll now try a 2.32.0 stretch backport with the above "keys" fix and 
locally backported coreutils
(I had to build lintianwith nocheck due to several tests failing due to 
coreutils
not being 8.30 at build time (and maybe other errors))

Reply via email to