On Wednesday, April 17, 2002, at 09:24 , Jaimee Spencer wrote:
> > #!/usr/bin/perl > # list all of the perl modules installed > use File::Find ; > for (@INC) { find(\&modules,$_) ; } > > sub modules > { > if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return } > return unless /\.pm$/ ; > my $fullPath = "$File::Find::dir/$_"; > $fullPath =~ s!\.pm$!!; > $fullPath =~ s#/(\w+)$#::$1# ; > print "$fullPath \n"; > } the great Trick - and thank you for the snappy intro to File::Find since I have never been there... thank you! what I did run into is one of those odd annomalies that happens - that piece of code 'ran away' for reasons that were not clear until I started to check with: http://www.wetware.com/drieux/CS/lang/Perl/Beginners/simpleFindTest.txt it seems that this form of find causes a bit of a Mess if you pass in the $_ - I tried a few variations on a them #find(\&wants,$_) for(@The_Inc_We_Use); #for(@The_Inc_We_Use) { find(\&wants,$_) ; } #foreach( sort(@The_Inc_We_Use)) {find(\&wants,$_) ;} and they all 'ate it' - and this was true across three OS's. darwin, solaris, linux redhat 7.2 ... perl 5.6.1 but it will work with foreach my $dir (@The_Inc_We_Use) { find(\&wants,$dir); } since I wanted the idea to work - but wanted it to be sorted down to just the module names I offer you: http://www.wetware.com/drieux/CS/lang/Perl/Beginners/findModules.txt If this is actually a 'bug' how should it get reported back ???? I can not find a $VERSION nor anyone on the hoof for maintaining this. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]