use strict;
my $result=`ls -l /proc/*/fd/* | grep /home/httpd/perl/tmp/`;
my @result=split("\n",$result);
my (@pids,@files);
foreach my $line (@result) {
	if ($line=~m-/proc/(\d+)/fd-) {
		push(@pids,$1);
		$line=~m-(/home/httpd/perl/tmp/.*)-;
		push(@files,$1);
	}
}

$result=`wget --http-user=lonadm -q --http-passwd=litelite --output-document=- http://localhost/server-status`;

@result=split('<tr>',$result);

foreach my $line (@result) {
	if ($line =~ m -</b><td>(\d+)<td>-) {
		my $curpid=$1;
		print ("curpid is $1\n");
		for (my $i=0;$i<=$#pids;$i++) {
			my $pid=@pids[$i];
			my $file=@files[$i];
			if ($curpid == $pid) {
				$line=~m-<td nowrap>([^<]*)</tr>-;
				print("$pid has a tmp file $file, last known request is $1\n");
			}
		}
	}
}

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 root@localhost to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
