Now I am not sure of your implementation but something as simple as the following will grab the site content for you:
#!perl -w use strict; use LWP::Simple; my $site = $ARGV[0] || "http://www.perlskripts.com"; my $command = get($site); die "An error has occured!" unless defined $command; print $command;
From there you can do whatever you want with it as far as parsing goes. I even added some interaction from the user functionality in the above code which is not needed. At the very least you can use this code to see if the site has an issue or your code has an issue. I ran this against my own site and perlmonks site and had no issues.

You also seem to have a minor code error that keeps the script from running. Change the following:

my $ua = LWP::UserAgent->new( keep_alive => 1 ); timeout => 30 );
to this:
my $ua = LWP::UserAgent->new( keep_alive => 1, timeout => 30 );
Also change the following:
unless ($response->is_success) { print "Response status is: ", $response->status_line(); return undef; }
to:
print "Response status is: ", $response->status_line() unless ($respo +nse->is_success);
The return is not needed nor is it allowed.

Now with both those minor changes in place I run the script and get an error code 500 which I am assuming is because you have changed the IP addresses in your code to protect the innocent. :-)

If you plug in all your correct data back into this script you might have better results.


www.perlskripts.com

In reply to Re: Webpage Contents by Elijah
in thread Webpage Contents by Vanquish

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.