Solved

Counter in perl under NT.

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article will show, step by step, how to integrate R code into a R Sweave document
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…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now