#!/usr/local/bin/perl # $Id: showcnt.cgi,v 1.1 94/10/07 10:41:06 nrstools Exp $ # # showcnt - Display all current counters # printf "Content-type: text/plain\n\n"; ($sec, $min, $hour, $mday, $mon, $year) = localtime($^T); printf "Counters as of %02d/%02d/%02d @ %02d:%02d:%02d:\n", $mon + 1, $mday, $year, $hour, $min, $sec; sub GetCounter { open(COUNTERFILE,"<$counterfile") || die "can\'t open $counterfile: $!\n"; $text = ; close(COUNTERFILE); } $counterfile = "counters/cntgoss.txt"; &GetCounter; printf "Goss: %d\n", $text; $counterfile = "counters/cntclint.txt"; &GetCounter; printf "Clint: %d\n", $text; $counterfile = "counters/cntvera.txt"; &GetCounter; printf "Vera: %d\n", $text; $counterfile = "counters/cntrally.txt"; &GetCounter; printf "Rally: %d\n", $text; $counterfile = "counters/cntcgc.txt"; &GetCounter; printf "CGC: %d\n", $text; $counterfile = "counters/cntfar.txt"; &GetCounter; printf "Far: %d\n", $text;