From: Phil Stone Date: 2012-05-27T21:33:20+09:00 Subject: Am I justified to use a global variable if it must be used in all scopes? Hello, Ever since I started learning Ruby, I've been strongly discouraged from using global variables (http://www.caliban.org/ruby/rubyguide.shtml#style) (http://www.ruby-forum.com/topic/187685#819233). In a program I'm making, I have a variable (which stores an instance of a class) that is declared outside of any functions or classes. However, I need to be able to call its methods from various class and function scopes, and nothing but a global variable would let me do that. This variable is simply what the program is centered around, and must be accessed and edited by various classes. I'm not sure why a global variable would be such a bad habit in this case, especially since it is only one. Can I justify using it? -- Posted via http://www.ruby-forum.com/.