Now consider the following scenario:
project/MyConfig.pm project/runA.pl project/runB.pl
Now there is a single project with two scripts, runA.pl and runB.pl, both trying to load the same module, MyConfig.pm, as shown in Examples Example 6-12.
sub project_name { return 'Super Project'; } 1;
use lib qw(.); use MyConfig; print "Content-type: text/plain\n\n"; print "Script A\n"; print "Inside project: ", project_name( );
use lib qw(.); use MyConfig; print "Content-type: text/plain\n\n"; print "Script B\n"; print "Inside project: ", project_name( );
This scenario suffers from the same problem as the previous two-project scenario: only the first script to run will work correctly, and the second will fail. The problem occurs because there is no package declaration here.
We'll now explore some of the ways we can solve these problems.
 
Continue to: