in reply to Using variables in require file... not possible?

If I understand your question correctly, youare tryg to send data from the main program(file) to the module. I recently did that, and here is the code I used (names modified to protect the innocent):
MAIN code
my $ProgramDir; BEGIN{ ($ProgramDir) = ( $0=~m|(.+)\/.+$|, $0=~m|(.+)\\.+$| ,"."); } use lib ( $ProgramDir, ); # Current Program's Dir use MyModule ("$ProgramDir/MyModule.db3");
Inside the Module:
!/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|, "", ""); }
"import" gets called automaticall, on "use".

            "XML is like violence: if it doesn't solve your problem, use more."