Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

existing PERL modules?

by solbeach (Novice)
on Apr 17, 2005 at 01:32 UTC ( #448557=perlquestion: print w/replies, xml ) Need Help??

solbeach has asked for the wisdom of the Perl Monks concerning the following question:

Oh Wise & Knowledgeable Monks,
I know enough about PERL to be dangerous.
I would like to be able to have PERL report/display/print out a list of ALL modules which have been installed into PERL, such as the following abbreviated list...
File::Path File::Spec IPC::Open2 IO::Scalar MIME::Base64 MIME::QuotedPrint Net::SMTP Mail::Internet
How do I instruct or direct PERL to list all modules that it knows about & that are available for programming use?
You can lead {some|many|most} to knowledge, but a few will steadfastly refuse to think (for themsleves). Clue Repellant!

Replies are listed 'Best First'.
Re: existing PERL modules?
by davidrw (Prior) on Apr 17, 2005 at 02:38 UTC
    Be sure to check out all of the responses from the Installed Module thread (there were several methods listed) from a couple days ago.
Re: existing PERL modules?
by jacques (Priest) on Apr 17, 2005 at 01:37 UTC
    use HTML::Perlinfo; perlinfo(INFO_MODULES);

    That will show you all the modules on your system, their version number, their location, and whether or not they are core modules. It will also provide you with a link to the module documentation on CPAN.

      This module is a joke, right?
        The author (jacques) doesn't think so , judge for yourself
              
        	        # This is the list for 5.8.3. 	
        		perl_info_print_table_row(2, "AnyDBM_File","The Perl5 Porters Mailing List");
        		perl_info_print_table_row(2, "Attribute::Handlers","Arthur Bergman");
        		perl_info_print_table_row(2, "AutoLoader","The Perl5 Porters Mailing List");
        		perl_info_print_table_row(2, "AutoSplit","The Perl5 Porters Mailing List");
        		perl_info_print_table_row(2, "B","Malcolm Beattie");
        		perl_info_print_table_row(2, "B::Asmdata","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Assembler","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Bblock","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Bytecode","Nicholas Clark");
        		perl_info_print_table_row(2, "B::C","Nicholas Clark");
        		perl_info_print_table_row(2, "B::CC","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Concise","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Debug","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Deparse","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Disassembler","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Lint","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Showlex","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Stackobj","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Stash","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Terse","Nicholas Clark");
        		perl_info_print_table_row(2, "B::Xref","Nicholas Clark");
        		perl_info_print_table_row(2, "Benchmark","The Perl5 Porters Mailing List");
        		perl_info_print_table_row(2, "ByteLoader","Nicholas Clark");
        		perl_info_print_table_row(2, "CGI","Lincoln D. Stein");
        		perl_info_print_table_row(2, "CGI::Carp","The CGI-Perl Developers mailing list");
        		perl_info_print_table_row(2, "CGI::Cookie","Lincoln D. Stein");
        		perl_info_print_table_row(2, "CGI::Fast","Lincoln D. Stein");
        Looks like a joke to me.
Re: existing PERL modules?
by strat (Canon) on Apr 17, 2005 at 09:20 UTC
    Well, you could filter the files in the subdirectories in @INC with the extension .pm...
    use File::Find; foreach my $dir (@INC) { find( sub { if (-f $_ and /\.pm/) { my $module = $File::Find::name; $module =~ s|\Q$dir\E/||; # remove part of @INC $module =~ s|\.pm$||; # remove extension .pm $module =~ s|/|::|g; # translate / to :: print "$module\n"; } # if }, $dir); } # foreach

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

      In similar vein, I've found this little program surprisingly useful:

      [~]$ cat `which pmwhich` #!/usr/bin/perl use warnings; use strict; die "pmwhich module-name\n" unless @ARGV == 1; my $module = $ARGV[0]; $module =~ s!::!/!g; for my $dir (@INC) { my $fqn = "$dir/$module.pm"; if (-e $fqn) { print $fqn, "\n"; last; } } [~]$ pmwhich bigint /usr/lib/perl5/5.8.5/bigint.pm [~]$
      It's a quick way to find out whether a particular module is installed -- and it helps me learn the tricks other module-writers have used. Shoulders of giants, y'know?

      Markus

Re: existing PERL modules?
by cog (Parson) on Apr 17, 2005 at 16:12 UTC
Re: existing PERL modules?
by Juerd (Abbot) on Apr 17, 2005 at 14:41 UTC
    The language is called Perl, the interpreter is perl. Both are not PERL. Perl is not an acronym. See perlfaq1.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://448557]
Approved by tlm
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2023-10-04 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?