I'm working with libwww for the first time. I am trying to parse the content on a html page on a intranet server to find a certain error code. Basically, what I'm using is this: $fileToCheck = 'http://internalservername/'; use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("MyFirstAgent /" . $ua->agent); $req = new HTTP::Request HEAD => $fileToCheck; $res = $ua->request($req); if ($res->is_success) { print "file $fileToCheck exists\n"; print $res->content; } else { print "file $fileToCheck doesn't exist\n"; } $res->content is always nothing. That's my problem. When I break there, and 'X res', here's what my feedback looks like: '_content' => '' '_headers' => HTTP::Headers=HASH(0x11297c4) 'accept-ranges' => 'bytes' 'client-date' => 'Fri, 15 Sep 2000 10:58:34 GMT' 'client-peer' => '10.0.0.4:80' 'content-length' => 1775 'content-location' => 'http://internalservername/Default.htm' 'content-type' => 'text/html' 'date' => 'Fri, 15 Sep 2000 11:01:05 GMT' 'etag' => '"0a4e2ee8cc7bb1:20ee"' 'last-modified' => 'Fri, 01 Nov 1996 00:38:00 GMT' 'server' => 'Microsoft-IIS/4.0' '_msg' => 'OK' '_protocol' => 'HTTP/1.1' '_rc' => 200 '_request' => HTTP::Request=HASH(0x1126338) '_content' => '' '_headers' => HTTP::Headers=HASH(0x1126308) 'user-agent' => 'MyFirstAgent /libwww-perl/5.45' '_method' => 'HEAD' '_uri' => URI::URL=ARRAY(0x11263d4) 0 URI::http=SCALAR(0x10f8628) -> 'http://internalservername/' 1 undef Is libwww such that an http://internalservername won't work? Does it have to be a IP Address or a www.*.com address? Am I barking up the wrong tree with libwww and should be using Sockets instead? Any help would be appreciated! margaret no spiffy quotes.

In reply to retrieving html content from intranet server by ophielia

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.