David Wheeler <[EMAIL PROTECTED]> writes:

> On Friday, September 5, 2003, at 04:58  AM, Joe Schaefer wrote:
> 
> > s/FETCH/NEXTKEY/; C<scalar FETCH> always yields the first
> > value of a multivalued key.  Unless something has changed
> > recently, C<each() in list context> still doesn't do what
> > the documentation suggests.
> 
> What is it supposed to do?

If $t references a table consisting of 3 entries:

  (foo => 1)
  (foo => 2)
  (foo => 3)

then the docs say that

  print "($a => $b)\n" while ($a, $b) = each %$t;

will reproduce the above 3 lines.  But what you actually
get is

  (foo => 1)
  (foo => 1)
  (foo => 1)

> Apache::FakeTable apes Apache::Table much more closely now, including
> its C<each> behavior, as well as C<keys> 

Neat.

> and C<values> (the latter being pretty much useless).

Too bad that Apache/APR::Table doesn't get this right.  Maybe
we should have a look at how Matt Sergeant implemented CDB_File,
since he may have found a way/hack (requires XS) to get each() 
and values() to DTRT with multivalued keys.

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to