From: patrick-may@... (Patrick May) Date: 2002-05-16T07:40:34+09:00 Subject: Re: cgi params api My main issue with the params api: + cgi["key"] returns multiple values, which is not the most useful thing. I think it should return a single value, either by joining the array or shifting the first param off. I see two ways of getting multiple values from the cgi: + cgi.params["key"] (exists) + cgi["key"].values or cgi["key"].to_a, etc. There isn't a *whole* lot of difference between these two. The former is easier to explain and to code. The latter allows you to ask the parameter itself for its multiple form without needing the cgi. Both methods allow the programmer to decide whether s/he wants to work with a single param or an array. I thought I liked cgi["key"].values, but I see how it is more confusing. Now I think that the simpler/better solution is to change cgi["key"] to return the singular (I believe Dossy suggested something like this earlier?). cgi.params["key"] would continue to return the array. This changes the api the least. # single=value&multiple=first&multiple=last cgi["single"] == "value" cgi["multiple"] == "first\0last" cgi.params["single"] == ["value"] cgi.params["multiple"] == ["first", "last"] ~ Patrick