--pE9oldV/ca00Larp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2006.10.28 21:05, Robert Klemme wrote:
> camenix <vipeak / gmail.com> wrote:
> >Is here anyone who can help me?
> >1. eval File.read('config.rb')
> >
> >It won't work till use global varibale in
> >main.rb :
> >eval File.read('config.rb')
> >puts $tool_mysql
> >OR:
> >main.rb :
> >tool_mysql=''
> >eval File.read('config.rb')
> >puts tool_mysql
> 
> What exactly does not work?  Did you by chance test in IRB?  That cannot be 
> trusted with regard to local variables.  Please show a bit more (including 
> error message).

Any variables defined in evalspace are not available outside evalspace.

  eval 'foo = 4'
  p foo               # Undefined error
  p eval('foo')       # Fine

Definining the variable beforehand (as in the second workaround above)
will produce no problems.

--pE9oldV/ca00Larp
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFQ4nk7Nh7RM4TrhIRAnNCAKDXOB/obN1Soqc4hxd2S+Oq5EhNuQCdGRvv
98JSjboelLeycps8j96+gKg5
-----END PGP SIGNATURE-----

--pE9oldV/ca00Larp--