in reply to File Copy on Linux
Here is a program that runs on RH Linux 9 that will list all the Perl modules installed on the system:
#!/usr/bin/perl - w # checkmodule.pl use strict; use File::Find; my @files; find sub { push @files, $File::Find::name if -f _ && /\.pm$ +/ }, @INC; my ($mod, $hash, $name); my (@results, %hash, @results2); @results = map {/.+\/.+\/(.*)\.pm$/} @files; #@results = sort {uc($a) cmp uc($b)} @results; #@results = map {/.+\/.+\/(.*)\.pm$/ and ucfirst($1)} @files; $hash{$_}++ foreach (@results); foreach (sort {uc($a) cmp uc($b)} keys %hash) { print "$_.pm \n"; } #@results2 = grep( ($hash{$_} == 1), keys %hash ); #print join "\n", @results2; #print "\n";
BTW, I got the program here on Perl Monks. Someone listed it as part of their answer to a question asked. I wish I could remember where I got it so I could give proper attribution.
xenchu
|
---|