Skip Menu |

This queue is for tickets about the Array-AsHash CPAN distribution.

Report information
The Basics
Id: 77572
Status: open
Priority: 0/
Queue: Array-AsHash

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Odd Array Lookups
Date: Thu, 31 May 2012 16:49:13 -0700
To: bug-array-ashash [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Given this script: my $lines = Array::AsHash->new({ array => [ foo => 'David', bar => 'Julie', baz => 'Anna', foo => 'Alex', yow => 'Fred', ]}); say $lines->aindex('foo'); say $lines->key_at(2); say $lines->key_at(6); say $lines->value_at(3); I expect this output: 6 baz baz Julie What I see instead is: 6 baz Alex Huh? What does it thing "Alex" is value 3? And why does it not find the key "baz" at index 6, even though aindex() finds it there? Thanks, David
Sorry, the `say` lines should be: say $lines->aindex('foo'); say $lines->key_at(0); say $lines->key_at(6); say $lines->value_at(3); And the output is: 6 foo Alex But I would expect: 6 foo foo Julie Not that it matters, same issue either way, I guess.