#!/usr/bin/perl -w # # $Id: mkindex.pl,v 1.2 2000/01/28 16:07:37 kjc Exp $ # # usage: mkindex.pl # mkindex.pl searches files whose names are ".html" in # the current directory, and creates an index page for them. # $idxfile = "index.html"; open(HOUT,"> $idxfile"); print HOUT "\n"; print HOUT "Traffic Trace Page\n"; print HOUT "\n\n"; print HOUT "\n"; print HOUT "

Traffic Trace Page

Daily Trace
\n"; $month = 0; while (<*.html>) { if (/^(\d{4})(\d{2})(\d{2})(\d+).html/) { if ($month != $2) { $month = $2; print HOUT "\n\n
$1/$month: <\B>\n"; } print HOUT " $3 \n"; } } print HOUT "

\n"; print HOUT < EOF close(HOUT); exit 0;