While TMTOWTDI is certainly a feature of Perl,
it's unclear exactly what you're attempting to achieve.
Based on what you have written, I tend to agree with AM's comment,
perhaps with a small qualification: "... you're probably not using modules correctly ...".
The following points are somewhat simplistic.
I'd be happy to expand upon them when you've clarified your intent.
-
The most common usage is to load a module at compile time (see use)
then access its subroutines as required.
-
You can conditionally load a module at compile time using the if pragma.
-
You can (conditionally) load a module at runtime using the require function.
If you provide a short piece of code to demonstrate your use case,
we'd have a better idea of what you're trying to do.
This may lead to a better answer.
I'd also strongly recommend that you Create A New User —
this is a very simple process and, unlike other forums, does not require you to provide a lot of personal information.
This allows us to differentiate your posts from thousands of other anonymous posts.
It also has many benefits for you (non-exhaustive list):
search for your own posts;
edit your posts;
customise your PerlMonks experience;
access many features only available to logged in users.
|