From: Christoffer Sawicki Date: 2006-05-09T05:11:41+09:00 Subject: Re: "load"ing a file and keeping the current scope? On 5/8/06, Philip Hallstrom wrote: > How can I include the contents of magic_file.rb into both a and b "as is". > I've tried load() and it changes the scope so that magic_file.rb doesn't > realize it's in A or B. > > I guess I'm looking for the PHP include() equivalent. > > I realize this is a weird question and I realize in most situations this > is *not* the way to do it, but I don't have a choice... so please no "do > it this other way" solutions :) I believe the following is your only choice: eval File.read("magic_file.rb") -- Christoffer Sawicki