in reply to Re^2: Module vs Singleton
in thread Module vs Singleton

There's nothing wrong with singletons. This would be a good time to explore Moose, especially MooseX::Singleton. Following up on Anonymous Monk's "new", here's what I tried:
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);