In scriptA.pl
, there is use DBI
In scriptB.pl
, there is require \"scriptA.pl\"
But we still cannot use DB
I find myself wondering what it is you are attempting to achieve?
If you simply want to reduce boilerplate code (15 common use Foo
declarations in every file), you can use a module like ToolKit to create a standard set of modules to use:
Put this into Powerboy.pm:
package Powerboy;
use base 'ToolSet';
ToolSet->use_pragma( 'strict' );
ToolSet->use_pragma( 'warnings' );
ToolSet->export(
'DBI' => undef, # Export the default set of symbols
);
1;
And then in your scripts, simply do:
use Powerboy;
# We have strict, warnings and DBI now.