Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #66818] Inconsistent behaviour when iterating over %*VM.kv

0 views
Skip to first unread message

Moritz Lenz

unread,
Jun 21, 2009, 1:44:43 PM6/21/09
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by Moritz Lenz
# Please include the string: [perl #66818]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=66818 >


The %*VM hash has the following structure

%*VM = (
config => {
'-Wcomment' => 1,
'-Wall' => 1,
# many more items here
}
);

as can easily be seen by %*VM.perl, and $*VM.keys has one item. However
iterating over $*VM.kv shows more than one key:

$ perl6 -e 'my $keys = 0; for %*VM.kv -> $k, $v { $keys++}; say $keys'
141

Somehow the inner hash is flattened. Using a normal hash I couldn't
reproduce
this behaviour.

Cheers,
Moritz

Patrick R. Michaud via RT

unread,
Jun 30, 2009, 10:47:24 PM6/30/09
to perl6-c...@perl.org
On Sun Jun 21 10:44:43 2009, moritz wrote:
> iterating over $*VM.kv shows more than one key:
>
> $ perl6 -e 'my $keys = 0; for %*VM.kv -> $k, $v { $keys++}; say $keys'
> 141
>
> Somehow the inner hash is flattened. Using a normal hash I couldn't
> reproduce
> this behaviour.

Now fixed in 6c6299f:

$ ./perl6 -e 'my $keys = 0; for %*VM.kv -> $k, $v { $keys++}; say $keys'
1

I'll pass this back to moritz++ to decide if this needs a spectest to
close the ticket.

Pm

0 new messages