Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

What Modules are Installed?

by crazyinsomniac (Prior)
on Apr 09, 2001 at 12:16 UTC ( #70946=snippet: print w/replies, xml ) Need Help??
Description: Based on vroom's suggestion(someplace), this script recurses through the directories in @INC, and prints out a list of files found there. You can also print only files ending in '.pm', that's why the 2 subroutines. I did this recently because my host throws an error at `perldoc perllocal`. (update: hmm, maybe I would have had better luck with `perlman perllocal`)
sub whats_installed
    require File::Find;

    for my $ix(0..$#INC)
        print $INC[$ix], "\n";
        File::Find::find(sub { print $File::Find::name, "\n"},$INC[$ix

sub whats_installed2
    require File::Find;

    for my $ix(0..$#INC)
        print $INC[$ix],"\n";
        File::Find::find( sub {substr ($_, -3) eq '.pm' && print $File
+::Find::name, "\n";}, $INC[$ix]);

Replies are listed 'Best First'.
Re: What Modules are Installed?
by mave (Sexton) on Apr 09, 2001 at 13:46 UTC
    Example 12-3 in the Perl cookbook, pmdesc, prints a list of modules, their version, the directory they are installed in, and their descriptions. You can download it from O'Reilly.
    -- mave
Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://70946]
[choroba]: No, if there are no threads, then the user wants to use MCE. If there are threads, the user can choose.
[1nickt]: choroba Understood. I'm wondering about the logic in a cpanfile. If the perl doesn't support threads, it's easy: require MCE. If the perl does support threads, as you say the user has a choice, so require both? Or, assume that irrespective of the choide
[1nickt]: ... choice, the threaded-perl user *probably* wants to use threads, therefore only require threads and leave MCE out, allowing the user to manually install if desired?
[choroba]: just require any of MCE and threads. Not sure if that's possible in the cpanfile, but should be possible early in the Makefile
[1nickt]: The app expects threads as default anyway, right?
[choroba]: that's true
[1nickt]: expects threads *to be* the default
[1nickt]: I think cpanfile can handle the logic. testing now.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2017-10-18 13:20 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (244 votes). Check out past polls.