On Mon, Dec 18, 2006 at 04:37:20PM +0530, positive mind wrote:
> In Linux, how do I check if a particular Perl module is installed or not on
> my system?

TIMTOWTDI

A couple useful examples have already been offered.  Here's mine:

  perl -MSome::Module -e ''

If the module is installed, it'll just quietly end.  If not, it'll give
you an error explaining how the module is missing.

Examples follow.  Technically (as you may guess from the mention of
BSDPAN), this is a FreeBSD system rather than a Linux system, but the
principle is the same.

input:
  perl -MGetopt::Std -e ''
no output (module present)

input:
  perl -MGetopt::Wakka -e ''
output (module not present):
  Can't locate Getopt/Wakka.pm in @INC (@INC contains:
  /usr/local/lib/perl5/5.8.8/BSDPAN
  /usr/local/lib/perl5/site_perl/5.8.8/mach
  /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl
  /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .).
  BEGIN failed--compilation aborted.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"The first rule of magic is simple. Don't waste your time waving your
hands and hopping when a rock or a club will do." - McCloctnick the Lucid

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to