package Foo; use MooseX::Singleton; has stuff => ( is => 'rw', isa => 'HashRef[Str]', default => sub { { default => 'new' } }, ); package main; my $instance = Foo->instance; my $same = Foo->instance; use Data::Dumper::Concise; print Dumper($same);
In reply to Re^3: Module vs Singleton
by Khen1950fx
in thread Module vs Singleton
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |