On Jan 23, 4:13 pm, Keith Carter <kmarplecar... / yahoo.com> wrote:
> Hm. You're right, that did work. How come the second bit below doesn't
> work?
>
> Loading development environment (Rails 2.0.2)>> eval("foo = 1")
> => 1
> >> foo
> => 1
> >> begin
> ?> eval("bar=1")
> >> bar
> >> end
>
> NameError: undefined local variable or method `bar' for
> #<Object:0x27bf9ec>
>         from (irb):5

For even more fun, evaluate bar once you've gotten the NameError.

>> bar
=> 1

Sorry, but I don't know why, only that it seems odd.