Hello
If you look at the top of the page, there is a box called "Search", and that's for searching the site. If you type in that box "list all modules", and press enter, voilla, you'll see how many times this question came up, along with the answers, as well as pointers to FAQs and code.
Hope this helps,,,
Aziz,,, | [reply] |
If you are using ActivePerl use the ppm and type the query command with no options.. that will list all the modules
installed with ppm
Glenn H.
| [reply] |
This will list all modules available in your search path.
perl -e 'while (<@INC>) { while (<$_/*.pm>) { print "$_\n"; } }'
-fuzzyping | [reply] [d/l] |
uh, nope. your code doesn't account for the modules that live in the sub directories... For example, try finding File::Spec with your code.
Probably best to stick to using File::Find to accomplish this job
| [reply] |
I think this code would not find Modules in Subdirectories, e.g. Net::Telnet, so I'd prefer using something like the following:
use File::Find;
# Module list
foreach my $dir (@INC){
find sub {
print "$File::Find::name\t" if /\.pm$/;
}, $dir;
}
or shorter:
use File::Find;
find sub {
print "$File::Find::name\t" if /\.pm$/;
}, @INC;
| [reply] [d/l] [select] |
Yeah, I realized that shortly thereafter. I've been picking my brain trying to figure out a way to do this with native functions, but I can't scale the recursion. Anyone else have any ideas? I've tried checking the input for (-d) and pushing it back to @INC, but my "while" doesn't seem to honor this attempt...
perl -e 'while (<@INC>) { while (<$_/**>) { if (-d) { push(@INC,$_) }
+elsif (/\.pm/) { print "$_\n" } else { next } } }'
-fuzzyping | [reply] [d/l] |