Hagbone has asked for the wisdom of the Perl Monks concerning the following question:
The issue/difficulty I've run into now is when I try to throw a little logic into the equation.use lib '/path/to/module/location'; use ModuleName;
I'd like to call one of a handful of modules based on a submitted parameter. For example:
The interesting thing I've encountered when trying this is that the logic/conditional seems to be ignored, and the functions within the module are available regardless of whether the parameter matches.use lib '/path/to/module/location'; if ( param('yo') =~ /inyourface/) { use UpYours; }
I'm just cutting my teeth on this strict/module stuff, so maybe there's something obvious I'm missing. Rather then call half a dozen modules I don't need, I'd like to be able to call the only one I need based on a parameter value.
Any insights would be appreciated.
|
|---|