in reply to loading modules on the fly with mod_perl

You should use Apache::Dispatch for this. It has been debugged by the community and the security issues (of which there are plenty with this kind of thing) have been dealt with.

However, your code is not so inefficient. Your call to require will check to see if the module is in %INC (i.e. if it has been loaded before) and will not load it again if it is.

  • Comment on Re: loading modules on the fly with mod_perl

Replies are listed 'Best First'.
Re: Re: loading modules on the fly with mod_perl
by echo (Pilgrim) on Aug 30, 2001 at 17:00 UTC
    I concur, there's no API in mod_perl to require modules. In fact Apache::Dispatch does the same as the poster (Dispatch.pm line 154) :
    eval "require $class";