package DataSomething; our $dbh; sub get_data { $dbh ||= new_connection(); ... etc. ... }