Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Most wise and virile Monks, please show me the error of my ways.

I'm having what I think is a problem with modules (not) being installed but I'm not finding the one that's actually causing me grief. I've got the following:

#!/usr/bin/perl use strict; use warnings; use diagnostics; use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get('http://www.perlmonks.com/'); print $mech->content;

that generates the following:

Uncaught exception from user code: Error GETing http://www.perlmonks.com/: Protocol scheme 'http' is not supported at ./test2.pl line 9. at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2751.

WWW::Mechanize::_die('Error ', 'GET', 'ing ', 'URI::http=SCALAR(0x10dbc80)', ': ', 'Protocol scheme \'http\' is not supported') called at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2738

WWW::Mechanize::die('WWW::Mechanize=HASH(0xed47d0)', 'Error ', 'GET', 'ing ', 'URI::http=SCALAR(0x10dbc80)', ': ', 'Protocol scheme \'http\' is not supported') called at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2385

WWW::Mechanize::_update_page('WWW::Mechanize=HASH(0xed47d0)', 'HTTP::Request=HASH(0x10dbea0)', 'HTTP::Response=HASH(0x1162710)') called at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2217

WWW::Mechanize::request('WWW::Mechanize=HASH(0xed47d0)', 'HTTP::Request=HASH(0x10dbea0)') called at /usr/lib/perl5/site_perl/5.8.8/LWP/UserAgent.pm line 410

LWP::UserAgent::get('WWW::Mechanize=HASH(0xed47d0)', 'http://www.perlmonks.com/') called at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 407

WWW::Mechanize::get('WWW::Mechanize=HASH(0xed47d0)', 'http://www.perlmonks.com/') called at ./test2.pl line 9

I'm "blessed" with using at Perl 5.8.8 on a RHEL 5.8 server and getting up to current isn't a healthy option at this time. As far as WWW::Mechanize I've got the following on the machine:

$ ls -l /usr/lib/perl5/site_perl/5.8.8/WWW total 104 drwxr-xr-x 2 root root 4096 Jul 23 12:56 Mechanize -rwxr-xr-x 1 root root 79472 Feb 2 16:38 Mechanize.pm drwxr-xr-x 2 root root 4096 Jul 23 12:47 RobotRules -rwxr-xr-x 1 root root 11155 Feb 18 06:05 RobotRules.pm $ ls -l /usr/lib/perl5/site_perl/5.8.8/LWP/Protocol/http.pm -r--r--r-- 1 root root 13822 Feb 11 08:02 /usr/lib/perl5/site_perl/5.8 +.8/LWP/Protocol/http.pm $ sudo perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.9800) Enter 'h' for help. cpan[1]> +install WWW::Mechanize WWW::Mechanize is up to date (1.72). cpan[2]> install LWP::UserAgent LWP::UserAgent is up to date (6.04). cpan[3]> install LWP::Protocol LWP::Protocol is up to date (6.00). cpan[4]> install HTTP::Request HTTP::Request is up to date (6.00). cpan[5]> install HTTP::Response HTTP::Response is up to date (6.03).

I'm just not seeing what I'm missing in order to get just this little bit 'o code to run. Help me, Obi Perl - you're my only hope.


In reply to Protocol scheme 'http' is not supported by ggerke

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!
  • 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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (8)
    As of 2015-07-08 03:11 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 (93 votes), past polls