projects
/
gitmo/MooseX-Singleton.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Re-implementation. This uses a bit of Moose meta magic to get real singletons.
[gitmo/MooseX-Singleton.git]
/
lib
/
MooseX
/
Singleton.pm
1
package MooseX::Singleton;
2
use Moose;
3
use MooseX::Singleton::Object;
4
use MooseX::Singleton::Meta::Class;
5
6
our $VERSION = 0.02;
7
8
sub import {
9
my $caller = caller;
10
11
Moose::init_meta($caller, 'MooseX::Singleton::Object', 'MooseX::Singleton::Meta::Class');
12
13
Moose->import({into => $caller});
14
strict->import;
15
warnings->import;
16
17
}
18
19
1;
20