no21 has asked for the wisdom of the Perl Monks concerning the following question:

Summary of my problem below:

1. Trying to write a script to log in to Yahoo and download some HTML
2. The script uses WWW::Yahoo::Login module, and I can't get it to work.
3. The error message leads me to believe I'm missing a module. I can't seem to install the missing module for reasons I do not know (regarding openssl or gcc?).
4. (I'm no Linux expert.) I'm running Fedora Core 2 and Perl v5.8.3 built for i386-linux-thread-multi.

Here are the details of my problem:

I am trying to write a script that uses the WWW::Yahoo::Login module. Actually, I installed WWW::Yahoo::Login and WWW::Mechanize from CPAN and then just tried to run the sample script from the WWW::Yahoo::Login module page on CPAN.org as follows:
===============================================
use WWW::Yahoo::Login qw( login logout ); use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $resp = login( mech => $mech, uri => 'http://mail.yahoo.com/', user => 'a_yahoo_user', pass => 'asecret', ); if ($resp) { print $mech->content; } else { warn $WWW::Yahoo::Login::ERROR; } # do some things unless ( logout(mech => $mech) ) { warn $WWW::Yahoo::Login::ERROR; }
=============================================================

Below is the error message I get from running the script:

=================================================================
Failed to fetch https://login.yahoo.com/: Protocol scheme 'https' is not supported (Crypt::SSLeay not installed) at test_yahoo_login.pl line 18. Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.3/WWW/Yahoo/Login.pm line 110. Failed to fetch : Can't locate object method "new" via package "LWP::Protocol::https::Socket" at test_yahoo_login.pl line 25. =================================================================

So, for starters, I figured I'd try to install the Crypt::SSLeay module from CPAN, but while trying to install Crypt::SSLeay from CPAN, I encountered this question:
=================================================================
CPAN.pm: Going to build C/CH/CHAMAS/Crypt-SSLeay-0.51.tar.gz No OpenSSL installation found, usually in /usr/local/openssl Which OpenSSL build path do you want to link against? =================================================================

So I typed the following at the command prompt.... $which openssl ...and this was returned: $/usr/bin/openssl So when I entered /usr/bin as the "build path" to link against, I get:
==============================================================
CPAN.pm: Going to build C/CH/CHAMAS/Crypt-SSLeay-0.51.tar.gz No OpenSSL installation found, usually in /usr/local/openssl
Which OpenSSL build path do you want to link against? /usr/bin/
Apparently no SSLeay installation at '/usr/bin/'
Are you sure you got it correct????
================================================
BUILD INFORMATION
================================================

ssl dir: /usr/bin/
libraries: -lssl -lcrypto -lgcc -lRSAglue -lrsaref
include dir: /usr/bin//include
ssl header: ssl.h
ssl candidate: /usr/bin/; /usr/bin//include

================================================
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lgcc
Note (probably harmless): No library found for -lRSAglue
Note (probably harmless): No library found for -lrsaref
Writing Makefile for Crypt::SSLeay
cp lib/Crypt/SSLeay/X509.pm blib/lib/Crypt/SSLeay/X509.pm
cp lib/Net/SSL.pm blib/lib/Net/SSL.pm
cp SSLeay.pm blib/lib/Crypt/SSLeay.pm
cp lib/Crypt/SSLeay/Conn.pm blib/lib/Crypt/SSLeay/Conn.pm
cp lib/Crypt/SSLeay/MainContext.pm
blib/lib/Crypt/SSLeay/MainContext.pm cp lib/Crypt/SSLeay/CTX.pm blib/lib/Crypt/SSLeay/CTX.pm
cp lib/Crypt/SSLeay/Err.pm blib/lib/Crypt/SSLeay/Err.pm
/usr/bin/perl /usr/lib/perl5/5.8.3/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.8.3/ExtUtils/typemap -typemap typemap
SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
gcc -c -I/usr/bin//include -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing
-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -march=i386 -mcpu=i686 -DVERSION=\"0.51\"
-DXS_VERSION=\"0.51\" -fPIC
"-I/usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE" SSLeay.c
/bin/sh: line 1: gcc: command not found
make: *** [SSLeay.o] Error 127
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
=============================================================

Why can't I install Crypt::SSLeay?
Are my problems bigger than just the fact that I can't install Crypt::SSLeay?

At this point I'm stuck. Any help would be greaty appreciated.

Edit by castaway - added sq.bracket html entities and readmore tags

Replies are listed 'Best First'.
Re: Trying to log in to Yahoo with Perl script
by moot (Chaplain) on Feb 12, 2005 at 19:23 UTC
    /bin/sh: line 1: gcc: command not found

    Looks like you might need to install a compiler (gcc), and/ or make sure it is in your path.

Re: Trying to log in to Yahoo with Perl script
by JSchmitz (Canon) on Feb 13, 2005 at 14:53 UTC
    Okay if you are running Fedora core gcc should be there it probably is just not in your path.

    From command line type this: which gcc
    if it does not find it that means it is not in your path

    to see where gcc is on your system type this find / -name gcc

    If you are running Fedora Core it is there somewhere you just need to add it to your path.

    to see that is currently in your path type echo $PATH

    gcc should be in /usr/bin by default so I it is strange that it would not already be in your path but whereever the find / -name gcc command turns it up you need to add it to your path here is an example of how I add just /usr/local to my path
    [jschmitz@www bin]$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/java/bin:/usr/l +ocal/ant/bin:/home/jschmitz/bin [jschmitz@www bin]$ PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/ +usr/local/java/bin:/usr/local/ant/bin:/home/jschmitz/bin:/usr/local (I added /usr/local to the end here) [jschmitz@www bin]$ export PATH [jschmitz@www bin]$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/java/bin:/usr/l +ocal/ant/bin:/home/jschmitz/bin:/usr/local [jschmitz@www bin]$
    If gcc turns out to really not be there at all you can grab it from http://www.rpmfind.net and install the rpm in a snap like so
    rpm -Uvh "name of file"

    Cheers!

    Jeffery