comparison 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
comparison
equal deleted inserted replaced
44:32d2350fccf9 45:1b1fb9d54f55
1 package IMPL::Object::Singleton;
2 use strict;
3 use warnings;
4
5 my %instances;
6
7 sub instance {
8 my $self = shift;
9
10 $instances{$self} || ($instances{$self} = $self->new(@_));
11 }
12
13
14 1;