use My::Config 'test'; package My::Config; sub import { my $package = shift; my $option = shift; #initialize DB connection here }