Hey guys and gals. I made this little test script to troubleshoot my logging into Yahoo.com (or the apparent inablility to do so within another script I'm writing). Now I know there's other pre-fab Yahoo modules and such, but I'm just trying to do my own thing and learn along the way.
#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTML::TokeParser; my $login = "xxxxxxxxxx"; my $password = "xxxxxxx"; my $url = "http://login.yahoo.com/config/login?"; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->form(); $mech->field("login","$login"); $mech->field("passwd","$password"); $mech->submit(); if ($mech->find_link( text => "Sign Out")){ print "Success!\n" } else{ print "Fail\n"; } my $test = HTML::TokeParser->new(\$mech->{content}); my $text = $test->get_text; print "$text";
Basically, the idea here was to attempt a login, then determine a success or failure by finding the sign out link. At the end I threw in a small parse command so I could see what the script is seeing. That's when I found out Yahoo is throwing even the unsecured logins through an SSL link. Here's the output:

Fail
LWP will support https URLs if the Crypt::SSLeay module is installed. More information at

Now I've read a few (apparently uninformed) sites on the web, and they've mentioned that Mech handles SSL natively. Further research seems to disprove this. Is my only option going through the whole crazy process of installing OpenSSL and then Crypt::SSLeay? It seems like a long way around just to get logged in. Help?
Thanks!


In reply to Mech and SSL by SpacemanSpiff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.