# Counter in perl under NT.

What do I have to change int this perl-script to get it to work under NT??? I have installed perl but  I don't know how to execute perlscript under nt....

#!/usr/bin/perl -w

$filename="counter.txt"; print "Content-type: text/html\n\n"; if (!open(COUNTER, "$filename"))
{
}

else
{
$count=<COUNTER>; close (COUNTER); if ($count =~ /\n$/) { chop($count);
}
}

$count++; if(!open(COUNTER, ">$filename"))
{
print "couldn't open for print\n";
}
else
{
print COUNTER "$count"; close (COUNTER); } print "$count";
LVL 1
###### Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x

Commented:
You don't have to do anything. If you installed a webserver, just make an extension '.pl' and give it the command 'C:\path\to\perl\bin\perl.exe'. When you run the cgi then, i will work fine... It worked at my server (omniHTTPD)

0

Commented:
Well, if you want to be able to handle simultaneous hits without your
processes steping on each others counters, you may want to flock.
0