Load vs. instance_eval

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 [email protected] 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs