#!/usr/bin/perl
print "Content-type: text/html\n\n";
opendir(INFILE, "dir.dat") || die ("Unable to open directory");
#this line gets rid of . and ..
@files = grep !/^\./, readdir(INFILE);
closedir(INFILE);
foreach $file (sort @files) {
print ("$file\n
");
}