From: u235321044@... (Ronald Fischer) Date: 2006-02-22T23:08:36+09:00 Subject: How to evaluate file as Ruby code? How do I evaluate a text file as a sequence of Ruby statements? (For those who happen to know Perl: I would like to have an equivalent of the Perl 'do FILENAME' feature). For example, I have a file "foo" which contains the lines abc=4 def=5 I would like to "evaluate" the file such that after this, the variable abc is set to 4 and def is set to 5. I tried the following: eval(File.new("foo").read) But after this, abc is still undefined. What am I doing wrong here? Ronald -- Sent by mn-pg-p-e-b-consultant-3.com from siemens subpart of com This is a spam protected message. Please answer with reference header. Posted via http://www.usenet-replayer.com