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