#!/usr/bin/perl opendir(CURDIR,".")|| die "Can't open current dir\n"; print "Content-type: text/html\n\n"; while (defined($file=readdir(CURDIR))) { next if ($file eq "."); next if ($file eq ".."); next if ($file eq "index.cgi"); stat($file); print "Directory $file
\n" if -d _; next if -d _; $fsize = -s $file; print " $file - $fsize bytes
\n"; } closedir CURDIR;