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

[perl #37441] @_ autovivifies hash slices

Thread Next
From:
James E Keenan via RT
Date:
June 18, 2013 01:03
Subject:
[perl #37441] @_ autovivifies hash slices
Message ID:
rt-3.6.HEAD-2552-1371517408-705.37441-15-0@perl.org
On Thu Jun 21 11:01:00 2012, doy@tozt.net wrote:
> On Thu, Jun 21, 2012 at 07:55:12PM +0200, demerphq wrote:
> > On 21 June 2012 19:47, Jesse Luehrs via RT <perlbug-
> followup@perl.org> wrote:
> > > This is still true in 5.16.
> >
> > But why is it a bug? Afaik it is supposed to happen.
> >
> > sub one { $_=1 for @_ }
> >
> > one(@foo{qw(x y z)});
> >
> > print $_,":", $foo{$_}, $/ for keys %foo;
> >
> > __END__
> >
> > y:1
> > x:1
> > z:1
> 
> Sure, it's clearly necessary in that case. But:
> 
> sub nop { }
> my (%foo, %bar);
> nop(@foo{'a', 'b'});
> nop($bar{'a'}, $bar{'b'});
> say "foo:";
> say for sort keys %foo;
> say "bar:";
> say for sort keys %bar;
> 
> __END__
> foo:
> a
> b
> bar:
> 
> I don't see a reason why %foo and %bar should end up being any
> different
> there.
> 
> -doy
> 

doy, demerphq:  

Dicussion in this RT petered out about a year ago.  Do you see any way
we could move this ticket toward resolution?

Thank you very much.
Jim Keenan


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

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