Deriving from that class will ensure that only one instance of your class will be returned:
Hope this helps.package Grok; use vars qw(@ISA); @ISA = qw(Class::Singleton); package Main; my $one = Grok->instance(); # returns a new instance my $two = Grok->instance(); # returns same instance
In reply to Re: Creating 'universal' instances of objects?
by bm
in thread Creating 'universal' instances of objects?
by Seumas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |