my $singleton; sub new { my $proto = shift; if ( !defined $singleton ) { $singleton = $proto->SUPER::new( @_ ); } return $singleton; }
In reply to Re^2: Making an Existing Class a Singleton
by friedo
in thread Making an Existing Class a Singleton
by agianni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |