Dirk Einecke wrote:

> Hi.

Moin!

> Now - why is defined? not working in my example?

defined?() is very magical and doesn't check the return value of the 
method call, but rather if the method itself exists at all.

Your example seems not to be working correctly -- I think that 
CgiParamsToLocal will raise an Exception when the element doesn't exist. 
(You're accessing @params[m.to_s][0], but @params[m.to_s] could be nil)

If I were you I would just return nil from method_missing and then do 
puts "p.foo" if p.foo or something similar in your actual code.

> greetings
> Dirk Einecke

Regards,
Florian Gross