On 2002.05.13, Wakou Aoyama <wakou / fsinet.or.jp> wrote:
> On Mon, May 13, 2002 at 01:37:40AM +0900,
>  Dossy wrote:
> 
> >   ['val1', 'val2'].to_s == 'val1'
> 
> if cgi["name"] return "val1"       ... maybe I don't notice "val2"
> if cgi["name"] return "val1\0val2" ... maybe I notice "val2"
> 
> therefore
> cgi["name"] return "val1" ... maybe cause make trouble

True, but in the Ruby idiom, cgi["name"] ought to return a
single value.  If you want to iterate over all the values,
you ought to do a cgi["name"].to_a.each to coerce the values
into an array to iterate over.

I really see these as being equivalent:

  cgi.value("name") == cgi["value"]
  cgi.values("name") { |value| ... } == cgi["name"].to_a.each { |value| ... }

Maybe that helps?

-- Dossy

-- 
Dossy Shiobara                       mail: dossy / panoptic.com 
Panoptic Computer Network             web: http://www.panoptic.com/ 
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)