in reply to existing PERL modules?

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"

Replies are listed 'Best First'.
Re^2: existing PERL modules?
by MarkusLaker (Beadle) on Apr 17, 2005 at 12:00 UTC
    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