On Mon, Jan 15, 2001 at 11:15:59AM +0000, Simon Wistow wrote:
> Not sure what Aaron means about Global variables. All classes can have
> public class variables which are theoretically global (aslong as you
> have access to the the instantiated Object). If you want truly global
> variables (as in accessible to all classes) you have to instantiate some
> class to hold them all and pass that to everything you instantiate
> [...]

Eh? You can just use public static variables, can't you?

In fact, in an OO perl program with "use strict" you'd
probably lump your globals into a package:

package Foo::Global;
use vars qw($frob @wibble);
$frob   = 23;
@wibble = (1..10);

and in Java you'd do the same thing:

package Foo;
public class Global {
  public static int   frob   = 23;
  public static int[] wibble = new int[] {1,2,3,4,5,6,7,8,9,10};
}


(Not directly related to the above:
  Perl's tremendous fun, I agree; but it doesn't follow that all
  other languages are "crap" :-) )

(Unprovable opinion:
  We can all sense that Perl's use in commercial environments
  has peaked, hence the sudden outbreak of defensive "advocacy")

 .robin.

-- 
"Have you been certain you came to me the real reason explain anything
else that I came to you the real reason explain anything else that I
came to you the real reason explain anything else?" --eliza

Reply via email to