From: David Alan Black Date: 2001-11-03T22:40:39+09:00 Subject: [ruby-talk:24261] param() method weirdness in cgi.rb Hello -- Here's something bizarre involving cgi.rb (at least, I have no idea whatsoever why it's happening). All I want to do is grab a hidden value. I'm using the param() method, which looks like this: def param(name) @params[name].join("\0") end However, it does nothing. It doesn't even seem to be getting called. If I change it to: def param(name) "BLAH!" end I still don't get a value. HOWEVER...... If I change the name of the method to "get_param", or "blah", or anything other than "param", it works. Here's my script: require 'cgi' @c = CGI.new("html4") def first @c.out do @c.html do @c.param("var") + "first time" + @c.form do @c.hidden("var", "hi") + @c.submit end end end end def second @c.out do @c.html do "second time" end end end case @c.param("var") when "hi" then second else first end If I change the two called to param to get_param (and change it in cgi.rb), then the flip from "first" to "second" works. Otherwise it doesn't. This is so weird that I feel a certain serenity about it.... Insights and explanations welcome. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav