#!/usr/bin/perl # this Perl should be called from Server Side included (shtml extension) pages # eg: # it will read the file with the name of the REQUEST_URI (the page whre the call is embeded) # that is stored under /cgi-bin/counters # presumably this file contains a counter that is incremented and stored back # The file name has an _ instead of / to reproduce the directory structure use strict; use CGI; my $query= new CGI; #my $page=$query->param("page"); my $page=$ENV{REQUEST_URI}; $page =~ s/\//_/g; print "Content-type: text/html\n\n"; my $count; my $line; $count=1; my $file="/u/b/bukovina/www.bukovinajewsworldunion.org/cgi-bin/counters/" . $page; open(CNT_FILE,$file) || print "Cannot open read $file - $!"; $line=; $count += $line; close CNT_FILE ; open(CNT_FILE,">" . $file) || print "Cannot open write $file - $!"; print CNT_FILE $count . "\n"; close CNT_FILE; print $count;