in reply to "our" versus "my" for class data

You won't get memory leaks per se, but you may sometimes get tripped by the somewhat random order of destruction in final cleanup.

This usually only makes a difference if your class data includes objects that have a DESTROY method, eg:

sub DESTROY { my $self = shift; $self->{dbh}->disconnect if $self->{connected}; }

In that example, during global destruction it is possible that $self->{dbh} has been destroyed before this object, in which case you'd get an error in that DESTROY.

I often get around that problem with a simple:

my $class_data; END { $class_data = undef }
.. which help to ensure things will be tidied up in an appropriate order by removing the need for perl to guess at a sensible order to destroy things.

Hugo