From: Daniel Carrera Date: 2003-06-27T12:45:49+09:00 Subject: Re: why can't I use $3somevar for global variable in ruby 1.8.0? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Huh? dcarrera ~ $ ruby -v ruby 1.8.0 (2002-12-24) [sparc-solaris2.8] dcarrera ~ $ irb >> $3somevar = "whatever" => "whatever" What's the problem? Try the above and see if it works for you. The problem might be elsewhere. On Fri, Jun 27, 2003 at 12:39:10PM +0900, Donglai Gong wrote: > Hi, I'm new to Ruby programming and I just upgraded from 1.6.8 to 1.8.0 > preview3. I noticed that I can no longer define global variables like > $3somevar (an example of the error I get is attached below). Ruby 1.8 > seems to complain about the 3 following the $ where it was perfectly > fine with it in 1.6.8. Is there a reason for this? Thanks. > > Regards, > Donglai > > ------------------------------------------------------------ > %ruby example.rb > example.rb:1: warning: useless use of a variable in void context > example.rb:1: syntax error > $3somevar = "whatever" > ^ > - -- Daniel Carrera | OpenPGP fingerprint: Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88 UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (SunOS) iD8DBQE++73mnxE8DWHf+OcRAtQaAJ98nMSfrphZhbeBidEoBjeGXaynvwCfV8Tl DEaO3WGwkWBXe/JB+V37BoI= =ayUw -----END PGP SIGNATURE-----