Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Find if I have module

by Anonymous Monk
on Aug 30, 2006 at 13:11 UTC ( #570377=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How can I find out if I have the below module in my Windows 2000?

use Mail::Sendmail;

I opened up ppm and not sure how to check from there because the help command doesnt say anything about what modules I have in my Perl 5.8.6

Comment on Find if I have module
Download Code
Replies are listed 'Best First'.
Re: Find if I have module
by borisz (Canon) on Aug 30, 2006 at 13:18 UTC
    No news is good news ;-)
    perl -MMail::Sendmail -e1
    Boris
Re: Find if I have module
by ww (Bishop) on Aug 30, 2006 at 13:25 UTC
    not the clearest of labeling, but ppm help DOES mention query... eg:
    c:\ppm ppm> query Mail
    should return a list of all modules beginning with Mail...

    Update to make explicit what was thought to be obviously implicit:  
    " return a list of all locally installled modules beginning..."

Re: Find if I have module
by planetscape (Chancellor) on Aug 30, 2006 at 14:19 UTC
Re: Find if I have module
by duff (Vicar) on Aug 30, 2006 at 14:00 UTC

    Not an answer to your question (you've already gotten those), but you might want to consider using Strawberry Perl as you'll have access to CPAN as you would on a normal unixish system.

Re: Find if I have module
by ChrisS (Monk) on Aug 30, 2006 at 17:05 UTC
    Try the technique listed here in its original context. Basically, you can try this:
    use ExtUtils::Installed; my $inst = ExtUtils::Installed->new(); my @missing = $inst->validate("File::BaseName"); # note the improper capitalization print @missing;
    In this case, the @missing array shows:
    File::BaseName is not installed...
    The validate method returns a list of the missing files. Some of the other methods could help, too.
Re: Find if I have module
by satchm0h (Beadle) on Aug 30, 2006 at 19:50 UTC
    eval to the rescue...
    eval 'require Mail::Sendmail'; warn "No Love ($@)" if ($@);

    ...stumbling down the path toward enlightenment
Re: Find if I have module
by jacques (Priest) on Aug 31, 2006 at 04:23 UTC
    This is a good way.
    use HTML::Perlinfo::Modules; my $m = HTML::Perlinfo::Modules->new(); $m->print_modules( show_only=>qr/Mail::Sendmail/ );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://570377]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-07-30 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls