Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Best way to check for installed module

by extremely (Priest)
on Apr 04, 2002 at 20:47 UTC ( [id://156765]=note: print w/replies, xml ) Need Help??


in reply to Best way to check for installed module

The canonical way from the Cookbook is simply:
BEGIN { unless (eval "require MyModule") { warn "Eeek! no MyModule: $@"; } } BEGIN { unless (eval "use MyModule") { warn "Eeek! no MyModule: $@"; } }

--
$you = new YOU;
honk() if $you->love(perl)

Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-16 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found