I think you misunderstood what Module::CoreList is for: it tells you about the "core" modules, i.e. the ones that are included by default with any distribution of perl. It's often useful to know when a paticular core module entered the core, if you're trying to support older versions of perl.
A common way of finding out if you have a module is:
If you get a version number, it's there, if not, you don't have it.perl -MSome::Module -e'print $Some::Module::VERSION, "\n"'
From within perl code, I'd be inclined to require it and trap the error to find out if the require failed. Something like this:
use Carp; my $module = "CGI"; eval "require $module"; if ($@) { carp "Problem with require of $module: $@"; } else { print "We have $module installed\n"; }
In reply to Re: CoreList stuff
by doom
in thread CoreList stuff
by neutron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |