From: matz@... (Yukihiro Matsumoto) Date: 2000-03-24T16:19:24+09:00 Subject: [ruby-talk:02125] Re: Scope violated by import via 'require'? Hi, In message "[ruby-talk:02101] Re: Scope violated by import via 'require'?" on 00/03/23, Clemens Hintze writes: |> require()/load() evaluates the contents of the file at the toplevel. | |So does that mean it works as you intended? Yes. | May I ask another |question? How can I achieve the goal described above? Is there any |way? Well, typical one is like following. str = f.read Foo.module_eval str |> module Bar is defined at the toplevel. And in 1.5.x, `::' notation |> accesses the constants defined in superclasses too, which makes |> Foo::Bar valid. | |That means, it is not in the module Foo, but will be found above in |Object, yes? Tricky, tricky! ;-) Yes. Tell me if you have alternative ideas. matz.