Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Base script behavior on presence (or non-) of a module

by flexvault (Monsignor)
on Dec 21, 2011 at 15:56 UTC ( [id://944653]=note: print w/replies, xml ) Need Help??


in reply to Base script behavior on presence (or non-) of a module

I just did this, and the "how to" was in the "Perl Cookbook" on pages 451-452. I recommend you take a look at the description, but the explanation is to but the test in a BEGIN block:

BEGIN { unless ( eval "use Fictitious::Module;, 1" ) { warn "couldn't use Fictitious::Module: $@"; } }
I hope I typed it correctly, as the book explains why it has to be exactly this way.

Good Luck

"Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found