[Xitami] problems running commony used Perl script
E. Egberts
xitami@lists.xitami.org
Wed, 17 Apr 2002 00:56:57 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0000_01C1E5AA.C6575DE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi,
Attached Perl script does not run properly on the Xitami webserver version
2.4d9 running on my Win98SE machine. It is a widely used script which is
part of LiveCounter classic. When triggering the script the following way:
http://www.familie-egberts.tk/cgi-bin/livecnt1.pl?v it should print some
version information (however, it does more than that!) but the browser
(IE5.5) stops responding for a while and then returns a blank screen.
No CGI (compilation) errors are reported. The pipexxxx.cgi file is empty and
the .cgo file only contains the content_type line. I'm lost, please help.
Thanks,
Egbert
--------------------
ICQ: 1398381
MSN: Tover@genie.nl
Fax: 00-31-30-6382461
--------------------
------=_NextPart_000_0000_01C1E5AA.C6575DE0
Content-Type: application/octet-stream;
name="livecnt1.pl"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="livecnt1.pl"
#! d:/perl/bin/perl
$sURLFilter =3D '';
$sIPFilter =3D '';
$sHostFilter =3D '';
$sCounterFilter =3D '';
$bAutoCreate =3D 0;
#------------------------------------------------------------------------=
---
{
local( $__COUNTER_DAT ) =3D 'livecntr.dat';
print "Content-type: text/plain\nPragma: no-cache\nCache-control: =
no-cache\nExpires: Mon, 28 Apr 1997 00:01:00 -0500\n\n";
if( $ARGV[0] )
{
local( $nCount ) =3D 0;
local( $Temp );
if( '' ne $ARGV[4] )
{
$ENV{'HTTP_REFERER'} =3D $ARGV[4];
}
if( $ARGV[1] && ( '0' ne $ARGV[1] ) )
{
$__COUNTER_DAT =3D $ARGV[1] . '.lcd';
}
if( -w "$__COUNTER_DAT" )
{
local( $bInc ) =3D 0;
if( open( F, "+<$__COUNTER_DAT" ) )
{
#flock( F, 2 );
seek( F, 0, 0 );
( $Temp, $nCount ) =3D split( /\s/, <F> );
if( 'i' eq $ARGV[0] )
{
local( $bFiltersOk ) =3D 1;
if( $sURLFilter && ( lc( $ENV{'HTTP_REFERER'} ) !~ $sURLFilter =
) )
{
$bFiltersOk =3D 0;
}
if( $bFiltersOk &&
$sIPFilter && ( $ENV{'REMOTE_ADDR'} =3D~ $sIPFilter ) =
)
{
$bFiltersOk =3D 0;
}
if( $bFiltersOk &&
$sHostFilter && ( $ENV{'REMOTE_HOST'} =3D~ $sHostFilter =
) )
{
$bFiltersOk =3D 0;
}
if( $bFiltersOk &&
$sCounterFilter && ( $__COUNTER_DAT =3D~ $sCounterFilter ) =
)
{
$bFiltersOk =3D 0;
}
if( $bFiltersOk )
{
seek( F, 0, 0 );
++$nCount;
print F "Total: $nCount\n";
$bInc =3D 1;
}
}
#flock( F, 8 );
close( F );
}
}
elsif( $bAutoCreate )=20
{
if( ( !( -e "$__COUNTER_DAT" ) ) && open( F, ">$__COUNTER_DAT" ) )
{
print F "Total: 0\n";
close( F );
}
}
print "c0=3D$nCount\n";
if( 'v' eq $ARGV[0] )
{
print "vr=3D99AX\n";
}
}
}
------=_NextPart_000_0000_01C1E5AA.C6575DE0--