#!/usr/local/bin/perl5 # # Created by Alison Greenwald 21 Sep 2000 # # #use strict; use CGI qw(:standard escapeHTML); use Time::Local; $DDIR="/data/cyrus"; $GRAPH="/cgi-bin/graph_cyrus_db.pl"; $q= new CGI; print $q->header(); print("Cyrus Stats"); print(""); opendir(DH, $DDIR) or die "Could not find data"; @files = readdir(DH); closedir(DH); %hash=(); $n=0; foreach (@files){ $server = ""; $ds = ""; $n++; ($server, $end) = split /\:/, $_, 2; ($ds,$throwaway) = split /\./,$end,2; # print("$server $ds $throwaway
"); if($ds ne "" && $ds ne ${$hash{"$server"}}[-1]){ #this if statement checks to see if $server is the same as the last #element in the array specified by this hash push @{$hash{"$server"}}, "$ds"; } } print("\n"); foreach $key( sort %hash){ if($hash{$key}){ print("

$key

\n"); } print("
\n"); print(""); #print head(), start_html("blah"), end-html();