!/usr/bin/perl -w use strict; use warnings; use Class::DBI; package MyModule; our $DBPath="MyModule.db3"; # Default file nme sub import{ my ($class,$newpath)=@_; $DBPath = $newpath || $DBPath; ## print "IMPORT: Setting path to '$DBPath' \n\t \n"; ## Delay this setting till AFTER IMPORT !! MyModule::DBI->connection(qq|dbi:SQLite:dbname=$DBPath|, "", ""); }