develooper Front page | perl.perl5.porters | Postings from July 2014

RE: [perl #122184] Bad STORE call for tied hash

Thread Next
From:
Ginzel Hans
Date:
July 1, 2014 05:23
Subject:
RE: [perl #122184] Bad STORE call for tied hash
Message ID:
25E71451EE3F2C46975E04688CE3DF410C77F311@CZ99PMBX01.CZGLI.LOCAL
Hello!

Thank you for your qick reaction. Both modules, DB::Meta and Class::PseudoIxIIHash are my own small code. The one is based on Class::PseudoHash. I dont see bug in the modules. I adedd debug messages to them. Both modules are included in this ticket.

What I am reporting is the difference between these two lines
$self->schemas($s)->{tables} = my $q = $self->{tables}{$s} = $ts = Class::PseudoIxIIHash->new unless $ts;
$self->schemas($s)->{tables} =               $self->{tables}{$s} = $ts =Class::PseudoIxIIHash->new unless $ts;

The variable $q is never used. Why does the Core Perl interpret these lines differently? It calls the STORE method on the returning value of $self->schemas($s)->{tables} but without the value argument in the second case.

Best regards
Hans Ginzel
________________________________________
Od: James E Keenan via RT [perlbug-followup@perl.org]
Odesláno: 29. èervna 2014 2:32
Komu: Ginzel Hans
Pøedmìt: [perl #122184] Bad STORE call for tied hash

On Fri Jun 27 02:49:11 2014, hans.ginzel@generali.com wrote:
> This is a bug report for perl from hans.ginzel@generali.com,
> generated with the help of perlbug 1.39 running under perl 5.10.1.
>
> -----------------------------------------------------------------
> Hello,
>
> please see attached file DB/Meta.pm lines 62 and below.
>
> # !!! This works perfectly
>  $self->schemas($s)->{tables} = my $q = $self->{tables}{$s} = $ts =
> Class::PseudoIxIIHash->new
>     unless $ts;
> # !!! This dos not work -- bad STORE call for the first asigning
> operation
>  $self->schemas($s)->{tables} =         $self->{tables}{$s} = $ts =
> Class::PseudoIxIIHash->new
>     unless $ts;
>
> Run perl -I`pwd` DB/t/01-meta.t
> See the difference in output when used first or second version of
> above.
>
> The interesting difference in debug messages is
>    PIxIIH STORE DB::Meta=REF(0x10b07f0): tables-
> >Class::PseudoIxIIHash=ARRAY(0x11a6358);
> DB::Meta:/home/T912205/lib/Perl/DB/Meta.pm:63
> versus
>   PIxIIH STORE DB::Meta=REF(0xfc1428): tables->;
> DB::Meta:/home/T912205/lib/Perl/DB/Meta.pm:66 at
> /home/T912205/lib/Perl/Class/PseudoI
>
> Why perl STOREs undef in the second case, please?
>
> The same output tested on Ubuntu with perl --version
> This is perl 5, version 18, subversion 2 (v5.18.2) built for i686-
> linux-gnu-thread-multi-64int
> (with 41 registered patches, see perl -V for more detail)
> and on Windows with Strawberry
> This is perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-
> x86-multi-thread-64int
>
> Best regards
> Hans Ginzel


This is not an appropriate ticket for the Perl 5 core distribution's bug tracker, rt.perl.org.

Whatever DB/Meta.pm and Class::PseudoIxIIHash may be -- Internet search turned up nothing relevant -- they are not code distributed with the Perl 5 core distribution.  Only bugs in that core distribution are on topic for this list.

I recommended going to a Perl help site such as perlmonks.org.

Thank you very much.
Jim Keenan

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