instmodsh only shows your locally installed modules - that is, the things you installed using CPAN. It will not list core modules or things that automatically come with your Perl distribution (for example, the debconf modules that are installed on all Debian systems).

To check if a particular module is installed, you can use the perldoc command:

If you want to see all the modules available given your current search path, try the following short script. This script works on both Win and *nix:

use strict; use warnings; use File::Find; my @aModules; foreach my $sDir (@INC) { my $crFind = sub { my $sModule = substr($File::Find::name, length($sDir)+1); push(@aModules, $sModule) if (($sModule =~ s/\.pm$//) || ($sModule =~ /\.pl$/)); }; find($crFind, ("$sDir/")) if -d $sDir; }; print '' . join("\n", sort @aModules) . "\n";

Note: the main difference between oko1's solution and mine is that oko1 provides support for filtering your module list with regexes but does not sort modules or list .pl files. The solution above does not support regex selection but does sort modules and list .pl files.

Best, beth

Update: fixed cut&paste error in script.

Update: eliminated warnings for missing @INC dirs; insured directory name is terminated with "/" so that File::Find doesn't think directory names with dots (e.g. /usr/share/perl/5.8) are files and skip them -silly File::Find) - with thanks to oko1 whose code sample below alerted me to these problems. Also added note comparing oko1 solution below and this solution.


In reply to Re: perl modules by ELISHEVA
in thread perl modules by manish.rathi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.