Forum: Ruby load vs. instance_eval

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
matt neuburg (Guest)
on 2009-03-20 02:50
(Received via mailing list)
Assuming f is an absolute path, is there any important difference
between load(f) and instance_eval(File.read(f))? I have been saying the
latter, but I'm thinking I could equally well say the former... Thx - m.
matt neuburg (Guest)
on 2009-03-20 02:55
(Received via mailing list)
matt neuburg <removed_email_address@domain.invalid> wrote:

> Assuming f is an absolute path, is there any important difference
> between load(f) and instance_eval(File.read(f))? I have been saying the
> latter, but I'm thinking I could equally well say the former... Thx - m.

Never mind, I see now that load pollutes the global namespace. m.
This topic is locked and can not be replied to.