Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Testing for a module's presence

by broquaint (Abbot)
on Feb 06, 2005 at 04:36 UTC ( #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


Comment on Re: Testing for a module's presence
Download Code
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
Node Status?
node history
Node Type: note [id://428421]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-12-18 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls