Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

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
Re: Find if I have module
by ww (Archbishop) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://570377]
Approved by Corion
[hippo]: On my tab key the left pointing arrow is directly above the right-pointing arrow (and they are each pointing at a vertical line). It's a UK keyboard.
[Discipulus]: choroba thanks.. now i understand: like find the tresaure.. but in this case seems true: no one noticed
[Discipulus]: Happy-the-monk every Eatalian understand what ctrl+shift+tab means: we just have different names for # and @ ('cancelletto' and 'chiocciola')

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-11-21 10:22 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (297 votes). Check out past polls.