Solved

Counter in perl under NT.

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 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