in reply to poop question

You can avoid the use of package globals in a singleton object by using a lexical. For instance:
package My::Singleton; my $DATA; sub get_data { my $class = shift; $class->_init unless defined $DATA; return bless $DATA, $class; } sub _init { $DATA = { foo => 42 }; }
Because $DATA is a lexical ("my") variable, it's only accessable to the subroutines defined in its scope. (In this case, a file scope, but you could add a bare block to hide it from other parts of the same file if you really want to.) See also Class::Singleton.