Hello,
I have a perl script that accepts three parameters from an initial HTML page: (
$cfurl - URL to access
$qry - String to query for
$proxy - alternate proxy URL to use
The URL being accessed used a tail -f @ the end of it so it is acessing a log file
continously. The Perl script below works terrific but the main problem is that I
cannot get the web server (where I'm running the script from) to disconnect from the
server it is accessing the logs from (another web server). I am running all this on
IIS4. When I type a netstat -n I get the following output:
TCP 137.34.183.112:2078 169.37.96.201:8081 ESTABLISHED
TCP 137.34.183.112:2081 169.37.96.201:8081 ESTABLISHED
TCP 137.34.183.112:2084 169.37.96.201:8081 ESTABLISHED
TCP 137.34.183.112:2087 169.37.96.201:8081 ESTABLISHED
and I cannot get the web server to close these connects after the user presses the
STOP button or closes their browser. The connections kep adding up and I cannot reduce
them. Here is the Perl code that I have and I am using the LWP:UserAgent module:
#Perl script used to obtain CacheFlow URL, query string, and proxy server from
#an html cover page and return filtered cacheflow information.
#Declaring modules
use CGI qw(:standard -nph);
use CGI;
use LWP::UserAgent;
use CGI::Carp qw(fatalsToBrowser);
#Declaring/Setting variables
$qry = param("qry");
$proxy = param("proxy");
$cfurl = param("cfurl");
if ($cfurl eq "alturlradio") {
$cfurl = param("alturltext");
$cfurl = "http://$cfurl";
}
#Code and subroutine to GET CacheFlow content and filter for query string
$ua = LWP::UserAgent->new;
$ua->proxy(http => $proxy);
#HTML Code for response page
print <<END_of_Multiline_Text;
Content-type: text/html
<HTML>
<HEAD>
<TITLE>Filtered CacheFlow Statistics</TITLE>
</HEAD>
<BODY>
<img align=left src="c:\\inetpub\\wwwroot\\csfbintranet.gif">
<H1 align=left>Filtered CacheFlow Statistics [Real-Time]</H1><BR>
<b>CacheFlow URL:</b> $cfurl
<BR>
<b>Query String:</b> $qry
<BR>
<b>Alternate Proxy:</b> $proxy
<HR>
<font size="4"><b>Filtered Output:</b></font>
<BR>
<pre>
END_of_Multiline_Text
my $responseg = $ua->request(HTTP::Request->new('GET',$cfurl),
sub {
($data,$response,$protocol) = @_;
#print $data;
#print "SEPARATOR ________________________________________________";
if ($qry eq undef) {
print $data;
}
else
{
@output = split /\n/,$data;
foreach (@output) {print grep (/$qry/,$_);}
}
});
#End-of-Script===========================================================================
I need to get the Perl script or web server it is running on to disconnect from
the other web server with the logs on it. Can anyone help?
MAny Thanks,
Billy
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web