I've just (very) recently gotten past the "trying to use require and strict" hurdle, thanks to the thread that turned up when I searched on strict and require here .... I'm now using:

use lib '/path/to/module/location'; use ModuleName;
The issue/difficulty I've run into now is when I try to throw a little logic into the equation.

I'd like to call one of a handful of modules based on a submitted parameter. For example:

use lib '/path/to/module/location'; if ( param('yo') =~ /inyourface/) { use UpYours; }
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.

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.


In reply to Using a paramter value to call a module by Hagbone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.