From: Pit Capitain Date: 2006-08-18T04:24:51+09:00 Subject: Re: using a module at the toplevel doesn't work Trans schrieb: > Unfortuately when I use this to make a Rake command-line emulator I > want to use the module at the toplevel and can't. Tom, I think I still don't get what your problem is. If you want to use a module at the toplevel just include it in Object. The module: module M def val *args if args.empty? @val else @val = args[ 0 ] end end end I used some instance variables here, because you wrote about them in the answer to Matz. Make it available at the toplevel (and everywhere else): class Object include M end p val # => nil val "main" p val # => "main" It's also available at the class level: class Q p val # => nil val "Q" p val # => "Q" end HTH Regards, Pit