I have a question about Apache::StatINC and reloading exported methods. Apparently methods that are exported from a module do not get reloaded when the module changes on disk (see the test script and test module below).
To test this, I start my apache in single process mode via '-X' and
access the URL for my test script and note the result. I then edit the
module, changing the text it prints out, and access the URL again. The
text remains unchanged.
If I change the function call to include the full package name and
access the URL, then I see the changes I made to the module.
If I leave the function call unqualified, but use the option:
PerlSetVar StatINC_UndefOnReload On
then I see the changes I made in the module.
So, the solution to my problem seems to be that I use the
'StatINC_UndefOnReload' setting. However, the man page says this
setting is for eliminating Perl warnings about re-defined subroutines,
not making Apache::StatINC work with exported methods. I'm not a big
fan of changing things until they work without understanding why,
because there's a good chance the fix was just coincidence and I'll get
bitten later with broken code.
Has anyone experienced this or know why this might be happening? Can
anyone explain why/if I can feel safe using 'StatINC_UndefOnReload' to
get the behavior I want? Thanks!
#### Here is the test script:
#!/usr/local/bin/perl -w
use strict;
use TestINC;
print "Content-Type: text/plain\n\n";
print "Calling test function: ";
testit();
print "Done\n";
#### and this is the test module:
package TestINC;
BEGIN {
use Exporter ();
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(testit);
}
sub testit {
print "testing!!!\n";
}
1;
--
|- Garth Webb -|
|- [EMAIL PROTECTED] -|
signature.asc
Description: This is a digitally signed message part
