develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #114628] Bleadperl v5.17.3-133-g3da9985 breaks DOY/Moose-2.0603.tar.gz

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
August 27, 2012 23:46
Subject:
[perl #114628] Bleadperl v5.17.3-133-g3da9985 breaks DOY/Moose-2.0603.tar.gz
Message ID:
rt-3.6.HEAD-11172-1346136401-1537.114628-15-0@perl.org
On Mon Aug 27 21:49:07 2012, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
> git bisect
> ----------
> commit 3da9985538c5eae2dd2de1309b320bc77f757687
> Author: Father Chrysostomos <sprout@cpan.org>
> Date:   Sun Aug 26 11:10:18 2012 -0700
> 
>     Croak for \local %{\%foo}
> 
> also affected
> -------------
> SPROUT/CSS-DOM-0.14.tar.gz

It should be an error, because the local does nothing in that case.  It
actually reveals a bug in CSS::DOM, which does something similar to this:

$list[0] = [];
{ local @{$list[-1]} = 3;
  use Data::Dumper; warn Dumper \@list }
warn Dumper \@list
__END__
$VAR1 = [
          [
            3
          ]
        ];
$VAR1 = [
          [
            3
          ]
        ];

Localising the element, not its dereferencement, is the correct thing to do:

$list[0] = [];
{ local $list[-1];
  @{$list[-1]} = 3;
  use Data::Dumper; warn Dumper \@list }
warn Dumper \@list
__END__
$VAR1 = [
          [
            3
          ]
        ];
$VAR1 = [
          []
        ];

That means CSS::DOM’s test suite is not good enough.

I’m looking into Moose now.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114628

Thread Previous | 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