Hi,
How can I check if a Perl Module is installed in my System from a Perl Program?
I want to do something like this:
#!/usr/local/bin/perl
if () {
use Quota;
}
Any help is appreciated.
Thanks,
Arijit
Start your day with Yahoo! - make it your home page _
Arijit Das wrote:
How can I check if a Perl Module is installed in my System from a Perl
Program?
#!/usr/local/bin/perl
if () {
use Quota;
}
my $has_quota = eval { require Quota; } ? 0 : 1;
if ($has_quota) {
require Quota;
...
}
else {
## not installed;
}
END
Title: Message
sub CheckLWP {
# The following eval/if
combination equates to a try/catch combination in C++
eval {
require LWP;
};
if ($@) {
#warn
$@;
my
($bad_module) = $@ =~ m/Can't locate (.+?).pm in [EMAIL PROTECTED]/;
print
"Failed to load P