in reply to javalike static

Well, for a database handle you could just use DBI->connect_cached(), and that's probably the best answer. For general use, static variables in perl are just globals:
package DataSomething; our $dbh; sub get_data { $dbh ||= new_connection(); ... etc. ... }