my $ProgramDir; BEGIN{ ($ProgramDir) = ( $0=~m|(.+)\/.+$|, $0=~m|(.+)\\.+$| ,"."); } use lib ( $ProgramDir, ); # Current Program's Dir use MyModule ("$ProgramDir/MyModule.db3"); #### !/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|, "", ""); }