Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Counter in perl under NT.

Posted on 1998-01-20
2
Medium Priority
?
205 Views
Last Modified: 2013-12-25
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"))
{
    print "couldn't open for read\n;"
}

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
Comment
Question by:pucko
2 Comments
 

Accepted Solution

by:
ihelpdesk earned 100 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 85

Expert Comment

by:ozo
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question