On Dec 17, 2003, at 11:45 AM, Dan Anderson wrote:
[..]
On Thu, 2003-12-18 at 06:03, Ajey wrote:hi, how can i find which perl modules are installed on linux os?
Well Linux distributions differ in what they install, and even then you can install or uninstall or change what modules are installed yourself,
first off my complements on a first pass at building a tree traversal to walk the @INC - but you forgot one minor detail
HTML::Form
would not show up in your listing.
My I offer you say: foreach my $inc_dir (@INC) { next if ($inc_dir =~ m|\.|); tree_traverse($inc_dir,$inc_dir); } print "That's all \n\n"; #------------------------ # sub tree_traverse { my ($dir,$base) = @_; opendir(DIR, $dir ) or return; my @allFiles = grep { $_ !~ /^\./ } readdir(DIR); closedir(DIR); my $frame = ''; unless( $dir eq $base ) { $frame = $dir; $frame =~ s!$base/!!; $frame =~ s!/!::!g; $frame .= '::' if $frame; } foreach my $file ( @allFiles ) { my $token = "$dir/$file"; if ( -d $token ) { tree_traverse($token, $base); }elsif ( $file =~ /(.*)\.pm/ ) { print "Module: $frame$1\n"; } } } # end of tree_traverse
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>