view Lib/IMPL/Object/Singleton.pm @ 45:1b1fb9d54f55

Starting web-application concept
author Sergey
date Fri, 29 Jan 2010 16:19:31 +0300
parents
children 75148ccd732d
line wrap: on
line source

package IMPL::Object::Singleton;
use strict;
use warnings;

my %instances;

sub instance {
    my $self = shift;
    
    $instances{$self} || ($instances{$self} = $self->new(@_));
}


1;