in reply to Find Perl Modules Installed.

Quick and Dirty answer
perl -e 'use UnknownModule'
if you get something like
Can't locate UnknownModule.pm in @INC (@INC contains: blah blah blah
Then it is not installed.

--

flounder

Replies are listed 'Best First'.
Re: Re: Find Perl Modules Installed.
by defyance (Curate) on Jul 02, 2002 at 00:36 UTC
    Don't remember where I got this code, I can't take credit for writing it. I probably found it searching here, infact, I'm positive that I did.

    Uses File::Find, quite handy..

    I know its lame to not remember the author.

    Here:

    #!/usr/bin/perl # list all of the perl modules installed use File::Find ; for (@INC) { find(\&modules,$_) ; } sub modules { if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return } return unless /\.pm$/ ; my $fullPath = "$File::Find::dir/$_"; $fullPath =~ s!\.pm$!!; $fullPath =~ s#/(\w+)$#::$1# ; print "$fullPath \n"; }


    --~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--
    perl -e '$a="3567"; $b=hex($a); printf("%2X\n",$a);'
    --~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--