Solved

Counter in perl under NT.

Posted on 1998-01-20
202 Views
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";
0
Question by:pucko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

Accepted Solution

ihelpdesk earned 50 total points
ID: 1831846
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

LVL 84

Expert Comment

ID: 1831847
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

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sums of coloumns in html/java 15 89
How to create a textarea which saves text in HTML 8 78
Permission on folders 6 35
killall tor  && service tor start  in Python 3 38
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month3 days, 20 hours left to enroll