From: gwtmp01@... Date: 2006-03-09T07:36:10+09:00 Subject: Re: globals outside of OO scripting On Mar 8, 2006, at 4:53 PM, rtilley wrote: > OK, but the script works wheter I use $ for globals and @ for > instance variables or not. With small scripts, why does it matter? Whether you use globals or top-level instance variables for a small script is pretty much irrelevant but what happens when your small script gets bigger or you want to reuse it in a larger project? Or you want to merge two small scripts to solve a slightly bigger problem? You'll have to wrap you little script in a class anyway and in that context the globals/instance variable solution isn't going to work. Much easier just to wrap it all in a trivial class to start with as Ara suggested. The very fact that you are using globals to provide a common state across functions or function calls cries out for a class/object solution to package that state. If it was drudgery to create a class then maybe it would be an issue but it is soooo easy in Ruby, so why fight it? Gary Wright