Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Conditional loading of module with global exports

by learnedbyerror (Monk)
on Feb 22, 2016 at 21:26 UTC ( [id://1155850]=note: print w/replies, xml ) Need Help??


in reply to Re: Conditional loading of module with global exports
in thread Conditional loading of module with global exports

UPDATE:My response below is not fully correct. The if pragma can work if combined with an environment variable. See post from Ken for details

lbe

Original below:

No, it will not. I considered this also. The if pragma is applied at compile time, not at run time. Since Getopt::Long has not yet processed the commend line, I do not yet have the information needed to provide the conditional for the if pragma.

  • Comment on Re^2: Conditional loading of module with global exports

Replies are listed 'Best First'.
Re^3: Conditional loading of module with global exports
by dasgar (Priest) on Feb 22, 2016 at 22:01 UTC

    Doing a search, I found Module::Load with the following description from its documentation: "runtime require of both modules and files". Based on that description, it sounds like something worth checking out.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1155850]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found