From: dblack@... Date: 2007-05-18T01:26:45+09:00 Subject: Re: quick question about @ and @@ Hi -- On Fri, 18 May 2007, Mike Steiner wrote: > What's the difference between @ and @@? Specifically, which should I use if > I need a global variable in a non-OOP Ruby program? @var is an instance variable (i.e., it represents the private state of whatever object is in the role of 'self' at the point where @var appears). @@var is a class variable, which is a kind of de-encapsulated thing shared among a class, its descendants, and all the instances of all those classes. There's no connection or relation between @var and @@var. $var is a global variable. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)