From: David Alan Black Date: 2002-05-13T20:43:18+09:00 Subject: Re: cgi params api Hello -- On Mon, 13 May 2002, Dossy wrote: > On 2002.05.13, Wakou Aoyama 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. Do you mean the CGI idiom? In Ruby, a hash value can be (and often is) anything, including an array (which really is a single value, or rather a single object). David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav