Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Check if module is installed

by hecroce (Friar)
on Nov 17, 2009 at 00:41 UTC ( #807584=note: print w/replies, xml ) Need Help??

in reply to Check if module is installed

Hi, This is what i did for a similar case:
use strict; use warnings; use ExtUtils::Installed; # # First, check if all the required modules have # been installed inthe system this script will run on. # BEGIN { my @import_modules = ( 'Getopt::Lucid', 'Apache::Htpasswd', 'IO::CaptureOutput' ); my ($inst) = ExtUtils::Installed->new(); my (@installed_modules) = $inst->modules(); for ( @import_modules ) { eval{ $inst->validate($_) }; if($@) { print qq{\n Module $_ does not seem to be installed in this system. Please install the module and try again!\n }; exit 1; } # end 'if' } # end 'for' } # end 'BEGIN' block

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://807584]
[shmem]: meh. setting up a SIG{__DIE__} before loading Net::SSLeay still triggers Can't locate object method "tid" via package "threads" at /usr/share/perl/5. 20/
[choroba]: setting in a BEGIN block?
[shmem]: choroba, yes

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-07-26 15:13 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (396 votes). Check out past polls.