Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Testing for a module's presence

by broquaint (Abbot)
on Feb 06, 2005 at 04:36 UTC ( [id://428421]=note: print w/replies, xml ) Need Help??


in reply to Testing for a module's presence

You could use Module::Locate for the job e.g
use Module::Locate 'locate'; print "Couldn't find Some::Module" unless locate 'Some::Module';
This code will return the path to the module if it is on the system or false if not. Also it doesn't load the module it just checks for its presence in the same manner that perl's require does.
HTH

_________
broquaint

Replies are listed 'Best First'.
CPAN knows how
by adamk (Chaplain) on Feb 06, 2005 at 06:06 UTC

Log In?
Username:
Password:

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

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

    No recent polls found