Hi!
I've been using the following code in the beginning of my scripts to check that a module installed.
$Module_is_installed = "N";
eval
{
require Module::Module;
};
if (!($@))
{
$Module_is_installed = "J";
}
if ($Module_is_installed eq "J")
{
# Do stuff
}
But, I've noticed that it doesn't work in some cases, for example, when using
require Mail::Sendmail 0.75;
, it doesn't work, telling me that there's a syntax error. If I switch to "use", it tells me that it can't locate Mail/Sendmail.pm.
Any ideas?