From: hemant kumar Date: 2006-08-09T12:28:37+09:00 Subject: Re: Question on how to source a file with variables in it. Or convert you file to a YAML. -----Original Message----- From: Ezra Zygmuntowicz [mailto:ezmobius@gmail.com] Sent: Wednesday, August 09, 2006 6:52 AM To: ruby-talk ML Subject: Re: Question on how to source a file with variables in it. On Aug 8, 2006, at 5:46 PM, Oscar Gon wrote: > I meant: > >> url = 'http://www.anydomain.com' >> contact = 'Joe' >> contactlast = 'Smith' >> > > -- > Posted via http://www.ruby-forum.com/. > The only way to do it with plain old local variables that I know of is to use eval. def load_vars(filname) eval(File.open(filename).read) end -Ezra