Scope useis a documented function:
use Module
Imports some semantics into the current package from a named module, usually by overlaying certain routines or variable names in your package.
You can do what you want, returning to the Stone Age, as in the following example, but please do not do this.
Using MyModuleas stand-in for DBI:
package MyModule;
use Exporter 'import';
our @EXPORT = qw/ foo /;
sub foo { print "$_[0]!\n" }
1;
and then call MyModule::foofromscriptA.pl
foo "from scriptA";
and scriptB.pl
foo "from scriptB";
use warnings;
use strict;
use MyModule;
do "scriptA.pl" or die;
do "scriptB.pl" or die;
print "done.\n";
:
from scriptA!
from scriptB!
done.
eval, , , .
, , scriptA scriptB - . , .
, Perl do require - . perlmod .