I have begun learning CGI from a book dated '96 which refers to UNIX as a
platform. I am using Win32 and have a question about an example from the
book, which I assume works on some system, just not mine, hehe.
What I do using I.E. 6.x is:
1. Enter the CGI path and filename in the browser Location field and press
the Enter key
2. Note: 'Internal Server Error' is received.
3. Apache error log says:
[error]  [client] The system cannot find the file specified.  :couldn't
spawn child process: path/trythis.cgi

I suspect the '&' but can not find a ref to this functionality on Win32 with
ActivePerl 5.8.0.805

#-----------trythis.cgi-------------
#!c/perl/bin/perl.exe
#
$data = 'C:/Apache2/Apache2/htdocs/counter.data';
$lockfile = 'C:/Apache2/Apache2/htdocs/counter.LOCK';
# main routine
print "Content-Type: text/html\n";
print "&increment";
sub increment {
  # read the data
  open(DATA,$data) || die "Can't open data file.\n";
  $accesses = ; $accesses++;
  close(DATA);
  # check for lock file
  while (-e $lockfile)
    { sleep 2; # wait 2 seconds }
  # create lockfile
  open(LOCK,">$lockfile") || die "Can't create lockfile.\n";
  close(LOCK);
  # write new value
  open(DATA,">$data");
  print DATA "$accesses\n";
  close(DATA);
  # delete lockfile unlink($lockfile);
}

Any help?

Thanks.

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to