develooper Front page | perl.perl5.porters | Postings from June 2016

Re: [perl #128482] Bleadperl v5.25.2-28-g8bf4c40 breaksMETADOO/Tie-REHash-1.05.tar.gz

Thread Previous
From:
demerphq
Date:
June 26, 2016 16:52
Subject:
Re: [perl #128482] Bleadperl v5.25.2-28-g8bf4c40 breaksMETADOO/Tie-REHash-1.05.tar.gz
Message ID:
CANgJU+WmUyU89TFfQpp9soNcOou7LoHebCg2897zDPVwKuqZzQ@mail.gmail.com
On 25 June 2016 at 13:02, Andreas J. Koenig via RT
<perlbug-followup@perl.org> wrote:
> # New Ticket Created by  (Andreas J. Koenig)
> # Please include the string:  [perl #128482]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=128482 >
>
>
> bisect
> ------
> commit 8bf4c4010cc474d4000c2a8c78f6890fa5f1e577
> Author: Yves Orton <demerphq@gmail.com>
> Date:   Mon Jun 20 22:51:38 2016 +0200
>
>     Change scalar(%hash) to be the same as 0+keys(%hash)

This tests that scalar() passes through to the perl internal
definition for scalar(%hash), which changed in 5.25

like($pre_v5_8_3 ? tied(%hash)->scalar : scalar(%hash), qr{\d+/\d+},
'Standard hash: buckets allocated in scalar context')
or diag('scalar %hash: '
. $pre_v5_8_3 ? tied(%hash)->scalar : scalar(%hash));

It could be changed to only test the booleanness of the scalar(%hash),
or it could be taught that in 5.25 and later the return of
scalar(%hash) is supposed to be the count of keys. I note that in
other contexts it  returns 0/1 so...

Yves

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About