in reply to Object singleton method
However, a singleton is really more of a design pattern, so there's a lot of ways to implement it. Rolling your own isn't that hard:
package MyClass; my $instance; sub get_instance { unless ($instance) { $instance = ...; # instantiate instance here } $instance; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Object singleton method
by sh1tn (Priest) on Jun 19, 2008 at 23:25 UTC |