develooper Front page | perl.perl5.porters | Postings from March 2013

Re: [rt.cpan.org #84256] Bleadperl v5.17.9-201-g3078e10 breaks SHARYANTO/Data-Schema-0.135.tar.gz

Thread Next
From:
demerphq
Date:
March 28, 2013 13:04
Subject:
Re: [rt.cpan.org #84256] Bleadperl v5.17.9-201-g3078e10 breaks SHARYANTO/Data-Schema-0.135.tar.gz
Message ID:
CANgJU+VD2a1T-9aE-7EJa1q_K5PaQ4hpuGb5EDg6WXrxd4wXLg@mail.gmail.com
On 28 March 2013 13:33, Andreas Koenig via RT
<bug-Data-Schema@rt.cpan.org> wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=84256 >
>
> As per subject. Canonical ticket for the issue is https://rt.perl.org/rt3//Public/Bug/Display.html?id=117313
>
> Hash randomization is involved.
>
> Since the cited commit we seem to have *only* fails on Data-Schema-0.135, not just random ones.
>
> Sample fail report:
>
> http://www.cpantesters.org/cpan/report/a533357e-90f4-11e2-aa31-fa243b384401
>
> HTH,

The module says:

NOTE: THIS MODULE IS DEPRECATED AND WILL NOT BE DEVELOPED FURTHER.
PLEASE SEE Data::Sah INSTEAD.

And the code failing is this:

sub _schema2csubname {
    my ($self, $schema) = @_;

    # avoid warning from Storable when trying to freeze coderef
    local $self->config->{gettext_function} =
        ($self->config->{gettext_function} // "")."";

    my $n1 = defined($schema) ? (ref($schema) ?
md5_hex(freeze($schema)) : $schema) : "";
    my $n2 = md5_hex(freeze($self->config));
    "__cs_${n1}_$n2";
}

I'd say this code only worked by chance anyway. The whole idea of
using Storable::freeze() as the basis of deduping things seems to me
to be fraught with error. The solution would be to use something like
Data::Dumper instead, with Sortkeys enabled.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next


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