Hello everyone
I want to list all the Perl modules installed on my system. The script
below does it well.
Unfortunately, it displays the name of each installed Perl module twice.
How can I get rid of them?
Lastly, if you have any suggestion about improving this script, it would
be very nice.
Thanks for your help.
use strict;
use warnings;
use File::Find;
no warnings 'File::Find';
my @files;
my @modules;
my @module;
find sub { push @files, $File::Find::name if -f _ && /\.pm$/ },
@INC;
foreach my $i (@files) {
@modules = split ('/', $i);
# print @modules;
# print "\n";
@module = grep (/\.pm$/, @modules);
print @module;
print "\n";
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>