Solved

# Counter in perl under NT.

Posted on 1998-01-20
200 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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…