From: Mike Steiner Date: 2007-05-18T01:36:07+09:00 Subject: Re: quick question about @ and @@ ------=_Part_19775_18785236.1179419766705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline That clears things up a lot. I'll use $var instead of @var for my (usually few!) global variables. Thanks! Mike Steiner On 5/17/07, darren kirby wrote: > > quoth the Mike Steiner: > > What's the difference between @ and @@? Specifically, which should I use > if > > I need a global variable in a non-OOP Ruby program? > > > > Thanks! > > > > Mike Steiner > > As I understand it, '@' denotes an instance variable, visible only to the > instance of a class, and '@@' is a class variable, visible to all > instances > of the class. > > If you need a plain old global try: $foovar > > -d > -- > darren kirby :: Part of the problem since 1976 :: http://badcomputer.org > "...the number of UNIX installations has grown to 10, with more > expected..." > - Dennis Ritchie and Ken Thompson, June 1972 > > ------=_Part_19775_18785236.1179419766705--