# in the package sub new { my $class = shift; # suck in a config, bless and populate $self return $self; } sub one_call_only { return bless {}, shift; } sub attach { my $thing = shift; my $self = ( ref $thing ) ? $thing : $thing->one_call_only(); # do attach() stuff with $self, and...: return $self->{ sub_details }; }