<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1012426" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1012426</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/using-lwpuseragent-module#comment-1071695</link>
    <description> &lt;p&gt;Rob, thanks for the reply! I&#039;ve been working on this problem for almost six months &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Umm, I&#039;ve got $| = 1 which flushes the output, and as each site is checked it shows in the browser as either ok or not ok, so I know the file gets opened.&lt;/p&gt;
&lt;p&gt;The LWP module is installed on the server.&lt;/p&gt;
&lt;p&gt;As far as I can tell there&#039;s nothing wrong with my code....but there has to be because it never runs to completion.&lt;/p&gt;
&lt;p&gt;Specifically the problem is when it encounters a site that is slow (super slow), it&#039;ll just hang and die. If you were to try one of these slow sites in Netscape it would say contacting host, and then after a few seconds a window would pop up saying the server is down, please try later.&lt;/p&gt;
&lt;p&gt;Try loading a file with a link that is super slow, that does the above in Netscape. If it works for you then, let me know.&lt;/p&gt;
&lt;p&gt;I appreciate your help!&lt;/p&gt;
 </description>
     <pubDate>Tue, 26 Sep 2000 20:18:06 +0000</pubDate>
 <dc:creator>sordid</dc:creator>
 <guid isPermaLink="false">comment 1071695 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/using-lwpuseragent-module#comment-1071691</link>
    <description> &lt;p&gt;I see nothing wrong with you code.  I tried it out and for me it worked flawlessly.&lt;/p&gt;
&lt;p&gt;Are you sure that the libwww-perl library is installed on your server?&lt;/p&gt;
&lt;p&gt;Are you sure that the file which contains the site is being opened properly when the script runs?&lt;br /&gt;
Try adding&lt;br /&gt;
open(FILE, &quot;$path_to_urls&quot;) or die &quot;Couldn&#039;t open file:$!&quot;;&lt;/p&gt;
 </description>
     <pubDate>Tue, 26 Sep 2000 19:40:56 +0000</pubDate>
 <dc:creator>Rob Pengelly</dc:creator>
 <guid isPermaLink="false">comment 1071691 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/using-lwpuseragent-module#comment-1071687</link>
    <description> &lt;p&gt;I should have included the code, eh? Here it is :&lt;/p&gt;
&lt;p&gt;#!/usr/bin/perl&lt;/p&gt;
&lt;p&gt;use LWP::UserAgent;&lt;/p&gt;
&lt;p&gt;print &quot;content-type: text/html\n\n&quot;;&lt;br /&gt;
$| = 1;&lt;/p&gt;
&lt;p&gt;open(FILE, &quot;$path_to_urls&quot;);&lt;br /&gt;
    @sites = ;&lt;br /&gt;
close(FILE);&lt;/p&gt;
&lt;p&gt;$ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(30);&lt;/p&gt;
&lt;p&gt;foreach $site (@sites) {&lt;br /&gt;
    $request = HTTP::Request-&amp;gt;new(&#039;GET&#039;, &quot;$site&quot;);&lt;br /&gt;
    $response = $ua-&amp;gt;request($request);&lt;br /&gt;
    if ($response-&amp;gt;is_success) {&lt;br /&gt;
          print &quot;$site is OK\n&quot;;&lt;br /&gt;
    } else {&lt;br /&gt;
          print &quot;$site is not OK\n&quot;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/p&gt;
 </description>
     <pubDate>Tue, 26 Sep 2000 18:54:59 +0000</pubDate>
 <dc:creator>sordid</dc:creator>
 <guid isPermaLink="false">comment 1071687 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
