Perrin Harkins wrote:
> Stas Bekman wrote:
> 
>> I think I've had enough coffee. PerlRun recompiles the code on each 
>> request, meaning that it re-runs any BEGIN blocks on each request. 
>> Meaning that My::Config will re-import %CF afresh.
> 
> That makes sense.  I was thinking that keeping track of which BEGIN 
> blocks had run was somehow separate from the compilation process, but 
> that seems pretty unlikely now that I think about it.

cool :)

>> Since use is almost the same as: require+import. require won't be 
>> called because the module will be already in %INC, but import will be 
>> always called.
> 
> PerlRun resets %INC after each run, meaning that it should be compiling 
> the used module again. 

It doesn't reset %INC completely, it only resets entries that were 
declared with 'package Foo' inside .pl:

     for (keys %INC) {
        next if $orig_inc{$_};
        next if /\.pm$/;
        delete $INC{$_};
     }

so any .pm modules loaded from the perlrun script stay in %INC.

Moreover, if My::Config was preloaded it'll stay in %INC for sure.

> That doesn't explain why he's having trouble though.

If it was a real problem we would have received loads of reports, since 
this is such a basic feature. Must be something else that messes up 
things for him. He has never followed up with more details, so it's hard 
to guess.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to