Perhaps a pair is a degenerate pseudo-hash (but then a pseudo-hash is
degenerate period.)
So the correct access should be
print keys %$array[0]
During the give and take of Topaz, having arrays and hashes have similar
access functions was bandied about. So that one could possibly have
a hash with a well defined array access. (Alphabetical, insertion order)
What such a syntax would look like?
Maybe it would fit in with only allowing a single whatzit under a
single name? (Not that I like that idea. I like having the index
be the same as the array. $account{$account}.)
So that $plural_whatzit[5] would access the 5th key in %plural_whatzit.
Confusion will reign.
<chaim>
>>>>> "JE" == Jon Ericson <[EMAIL PROTECTED]> writes:
JE> Damian Conway wrote:
>> > > When a pair reference is assigned (in)to an array, it remains a
>> > > single scalar (referential) value. So:
>> > >
>> > > @array = ( a=>1, b=>2, 'c', 3 );
>> > >
>> > > assigns four elements (not six) to @array.
>> The proposed C<key> and C<value> built-ins (or the extended C<keys> and
>> C<values>) would be used on a pair reference:
>>
>> print key $array[0]; # or perhaps: print keys $array[0];
JE> ^^^ Makes sense Mismatch ^ ^
>> print value $array[0]; # or perhaps: print value $array[0];
JE> ^ 's'
JE> But what does C<key $array[2]> do? Or C<keys @array>?
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183