package my_test_package; # Create a package global. my $ME = undef; # Return the required reference. sub new { # If $ME has been set do not bother doing all the init again. return $ME if defined $ME; my $class = shift; my $self = {}; # A lot of long-winded initialization. bless $self, $class; $ME = $self; return $self; } 1;