I'm experiencing difficulties when using PerlFreshRestart modules that
depend on %INC.  In my particular case I'm trying to use persistent
connections in DBI through Apache-DBI, and Apache/DBI is not in %INC
when PerlFreshRestart causes DBI to be loaded a second time.

In more detail, I've cut down my config file to little more than

PerlModule Apache::DBI

And I've altered DBI.pm to Dump out %INC to STDERR just before it checks
it to see if it contains Apache/DBI.  With PerlFreshRestart not set I
get this dumped out in my session.

$VAR1 = 'Data/Dumper.pm';
$VAR2 = '/opt/perl5.004_04/lib/site_perl/Data/Dumper.pm';
$VAR3 = 'Carp.pm';
$VAR4 = '/opt/perl5.004_04/lib/Carp.pm';
$VAR5 = 'Config.pm';
$VAR6 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/Config.pm';
$VAR7 = 'Apache/Server.pm';
$VAR8 = '/opt/perl5.004_04/lib/site_perl/Apache/Server.pm';
$VAR9 = 'Exporter.pm';
$VAR10 = '/opt/perl5.004_04/lib/Exporter.pm';
$VAR11 = 'strict.pm';
$VAR12 = '/opt/perl5.004_04/lib/strict.pm';
$VAR13 = 'overload.pm';
$VAR14 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/overload.pm';
$VAR15 = 'vars.pm';
$VAR16 = '/opt/perl5.004_04/lib/vars.pm';
$VAR17 = 'Apache/Constants.pm';
$VAR18 = '/opt/perl5.004_04/lib/site_perl/Apache/Constants.pm';
$VAR19 = 'DBI.pm';
$VAR20 = '/opt/perl5.004_04/lib/site_perl/DBI.pm';
$VAR21 = 'Apache/DBI.pm';
$VAR22 = '/opt/perl5.004_04/lib/site_perl/Apache/DBI.pm';
$VAR23 = 'AutoLoader.pm';
$VAR24 = '/opt/perl5.004_04/lib/AutoLoader.pm';
$VAR25 = 'Apache/Connection.pm';
$VAR26 = '/opt/perl5.004_04/lib/site_perl/Apache/Connection.pm';
$VAR27 = 'Apache/Constants/Exports.pm';
$VAR28 = '/opt/perl5.004_04/lib/site_perl/Apache/Constants/Exports.pm';
$VAR29 = 'Apache.pm';
$VAR30 = '/opt/perl5.004_04/lib/site_perl/Apache.pm';
$VAR31 = 'mod_perl.pm';
$VAR32 = '/opt/perl5.004_04/lib/site_perl/mod_perl.pm';
$VAR33 = 'DynaLoader.pm';
$VAR34 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/DynaLoader.pm';

With PerlFreshRestart on, I get two dumps, one in my session window, and
one in the error log; firstly:

$VAR1 = 'Data/Dumper.pm';
$VAR2 = '/opt/perl5.004_04/lib/site_perl/Data/Dumper.pm';
$VAR3 = 'Carp.pm';
$VAR4 = '/opt/perl5.004_04/lib/Carp.pm';
$VAR5 = 'Config.pm';
$VAR6 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/Config.pm';
$VAR7 = 'Apache/Server.pm';
$VAR8 = '/opt/perl5.004_04/lib/site_perl/Apache/Server.pm';
$VAR9 = 'Exporter.pm';
$VAR10 = '/opt/perl5.004_04/lib/Exporter.pm';
$VAR11 = 'strict.pm';
$VAR12 = '/opt/perl5.004_04/lib/strict.pm';
$VAR13 = 'overload.pm';
$VAR14 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/overload.pm';
$VAR15 = 'vars.pm';
$VAR16 = '/opt/perl5.004_04/lib/vars.pm';
$VAR17 = 'Apache/Constants.pm';
$VAR18 = '/opt/perl5.004_04/lib/site_perl/Apache/Constants.pm';
$VAR19 = 'DBI.pm';
$VAR20 = '/opt/perl5.004_04/lib/site_perl/DBI.pm';
$VAR21 = 'Apache/DBI.pm';
$VAR22 = '/opt/perl5.004_04/lib/site_perl/Apache/DBI.pm';
$VAR23 = 'AutoLoader.pm';
$VAR24 = '/opt/perl5.004_04/lib/AutoLoader.pm';
$VAR25 = 'Apache/Connection.pm';
$VAR26 = '/opt/perl5.004_04/lib/site_perl/Apache/Connection.pm';
$VAR27 = 'Apache/Constants/Exports.pm';
$VAR28 = '/opt/perl5.004_04/lib/site_perl/Apache/Constants/Exports.pm';
$VAR29 = 'Apache.pm';
$VAR30 = '/opt/perl5.004_04/lib/site_perl/Apache.pm';
$VAR31 = 'mod_perl.pm';
$VAR32 = '/opt/perl5.004_04/lib/site_perl/mod_perl.pm';
$VAR33 = 'DynaLoader.pm';
$VAR34 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/DynaLoader.pm';

(just as above) and then in the error log.

$VAR1 = 'Config.pm';
$VAR2 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/Config.pm';
$VAR3 = 'Carp.pm';
$VAR4 = '/opt/perl5.004_04/lib/Carp.pm';
$VAR5 = 'Data/Dumper.pm';
$VAR6 = '/opt/perl5.004_04/lib/site_perl/Data/Dumper.pm';
$VAR7 = 'Apache/Server.pm';
$VAR8 = '/opt/perl5.004_04/lib/site_perl/Apache/Server.pm';
$VAR9 = 'strict.pm';
$VAR10 = '/opt/perl5.004_04/lib/strict.pm';
$VAR11 = 'Exporter.pm';
$VAR12 = '/opt/perl5.004_04/lib/Exporter.pm';
$VAR13 = 'overload.pm';
$VAR14 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/overload.pm';
$VAR15 = 'vars.pm';
$VAR16 = '/opt/perl5.004_04/lib/vars.pm';
$VAR17 = 'Apache/Constants.pm';
$VAR18 = '/opt/perl5.004_04/lib/site_perl/Apache/Constants.pm';
$VAR19 = 'DBI.pm';
$VAR20 = '/opt/perl5.004_04/lib/site_perl/DBI.pm';
$VAR21 = 'AutoLoader.pm';
$VAR22 = '/opt/perl5.004_04/lib/AutoLoader.pm';
$VAR23 = 'mod_perl.pm';
$VAR24 = '/opt/perl5.004_04/lib/site_perl/mod_perl.pm';
$VAR25 = 'DynaLoader.pm';
$VAR26 = '/opt/perl5.004_04/lib/sun4-solaris/5.00404/DynaLoader.pm';

Why does PerlFreshRestart behave like this?  I don't understand why the
module is loaded twice, and more particularly why %INC is different the
second time.  Oh, I suppose I should mention that this is with
perl5.00404, apache/1.3.6 and mod_perl/1.19

Michael Smith

Reply via email to