http://qs321.pair.com?node_id=110123


in reply to OO vs. global variables...

Or you could use a singleton, which as I understand it is a way of doing objects so that any attempt to create a new object actually returns a refernce to the first (and only object) created. This way you can access the same object without having to hand refs around.

In practise this isn't done much, because modules do the same thing with a lot less fuss. If you want global variables, just create a module with variables in it, and access the variables from your main program. This is one of the times you can really appreciate Perl letting you break the rules in a good way.

____________________
Jeremy
I didn't believe in evil until I dated it.