in reply to Re: Unloading a perl module
in thread Unloading a perl module

I've tested this in the past. I found that even if you don't have a startup.pl and just let your cgi scripts use the modules, they still get loaded into global namespace to be shared by all the children. I didn't do a lot of testing in this area, so your results may vary. If they do, I'd love to hear more about it.

Replies are listed 'Best First'.
Re: Re: Re: Unloading a perl module
by jepri (Parson) on Nov 14, 2001 at 18:30 UTC
    The manual states (IIRC) that modules are shared until you modify internal variables, and then they become specific to the process that modified the variable. So as long as you don't keep state in the modules (few do) you will be getting the most efficient treatment.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Re: Re: Re: Unloading a perl module
by perrin (Chancellor) on Nov 19, 2001 at 20:52 UTC
    This is only true if your CGI scripts get loaded during startup, i.e. any modules you load and any modules they load during server startup will be shared via copy-on-write.