First of all, sorry I posted my reply to the list in a wierd spot.  These
are good suggestions, and we should get this back on the list for others
to see.  Then again, maybe this is already there and I can't see it yet :-)

> s|a: i prefer array
> s|a: with the first one, how could i get the same one twice in a row?
> seanoc: calling the method would wrap around and you could reset the
>         cursor and delete elements
> seanoc: I prefer the 2nd API... but am not wild about a dynamic return
>         type (ex: array vs string)
> 
> p['key1'] >> 'single_val'
> p['key2'] >> ['val1','val2']

This api is actually how I had been dealing with multiple values, but I
never really loved it.  I got excited about value.[multiple | values], b/c
it didn't have the smelliness of an unnecessary dynamic return type.*

I also like Wakou's suggestion that the single value would be the result
of array.join, and not just the first arg shifted.

> The 2nd API is perl-esque, but unheard of outside of perl, IMO.
> The 1st API is very Apache (internal data structures stored in tables).

I'm more concerned about utility than geneaology (sp?).  Single string
params are the common case; the api should make it easy to work with
these.  Next most common case is multiple params, last is files.

With multiple params, an interesting bit is that the programmer will
probably want to always code for an array.  If I have a group of
checkboxes, I'd rather do:

cgi['key'].values.each { |value|

}

than have to insert a check for the case when only one box is checked:

if cgi['key'].array?
    cgi['key'].each { |element|
        # do something with each...
    }
else
    # take care of the single param...
end
 
> I could care less.  Think of me as a bastard product of both so I'm
> not feeling decisive in this regard.  Someone suggested I write this
> bit of functionality in a non-mod_ruby specific way that way it could
> be used in WEBrick (sp?).  Opinions anyone?  -sc

There should be a single cgi interface that is flexible enough to handle
different enviroments.  This is a must.  If we make cgi more testable, it
would become something that would be easier to use across the board...

Maybe we should all develop our forks, then do a code review?

~ Patrick

* at least for the multiple args problem.  I think file uploads are best
handled with dynamic returns (instead of changing the interface for _all_
the params, including the ones you may already have code written to
handle...)