How to check installed Modules in perl
Dear All, I am new to perl. I would like to know what can I do to check whether I have installed particular module in perl. Thanks Alex
Re: How to check installed Modules in perl
On Apr 17, Alex Cheung Tin Ka said: >I am new to perl. I would like to know what can I do to check >whether I have installed particular module in perl. The simplest way is: perl -MModule -e0 If that runs without Perl saying "Can't find Module.pm in ...", you've got the module. Example: perl -MCGI -e0 -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** what does y/// stand for? why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to check installed Modules in perl
You can use the ExtUtils::Installed module to list all the modules installed in your copy of perl. It's available in CPAN. Gabby Dizon Web Developer Inq7 Interactive, Inc. http://www.inq7.net http://you.inq7.net - Original Message - From: "Alex Cheung Tin Ka" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 2:13 PM Subject: How to check installed Modules in perl Dear All, I am new to perl. I would like to know what can I do to check whether I have installed particular module in perl. Thanks Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to check installed Modules in perl
On Wed, 17 Apr 2002, Alex Cheung Tin Ka wrote: > I would like to know what can I do to check whether I have installed particular >module in perl. perldoc perllocal returns a list of modules that have been installed, but this is different from the modules that you can use. I am not too sure of how a modules gets included in this list, because there are modules in the list which I don't believe I installed myself. -- Greg Matheson It was said a million monkeys on a million typewriters Chinmin College would eventually write the works of Shakespeare. Now, thanks to the Internet, we know this is not so. http://www.research.att.com/~reeds/monkeys.html Taiwan Penpals Archive http://netcity.hinet.net/kurage> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to check installed Modules in perl
in windows: >ppm query "Jaimee Spencer" To: "'Alex Cheung Tin Ka'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: RE: How to check installed Modules in perl 04/17/2002 12:24 PM Hello Alex, You could run the below perl Script. Hopes this helps. Regards, Jaimee #!/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"; } -Original Message- From: Alex Cheung Tin Ka [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 16, 2002 11:14 PM To: [EMAIL PROTECTED] Subject: How to check installed Modules in perl Dear All, I am new to perl. I would like to know what can I do to check whether I have installed particular module in perl. Thanks Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to check installed Modules in perl
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]
RE: How to check installed Modules in perl
Drieux, Thanks for your insight on the below code. Findmodules.pl is a find piece of art with your mods. As for as reporting back the Bug! If it is a bug, I really can't answer that one. Once again thanks for rewrite and the link to your website. I never knew about it, it will for sure come in handy. Regards, Jaimee -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 7:02 PM To: [EMAIL PROTECTED] Subject: Re: How to check installed Modules in perl 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]