in reply to Dynamic Directory Index help

davido is right, it's mostly the variables that have gone missing, and for some reason $_ seems to have been replaced with "sh". Very bad points for a "technical" site. Anyway, I've tried to fix that, and removed a few bugs in the process (like forgetting about $dir in testing if it's a directory). Here it is:
#!/usr/bin/perl -w sub Get_Title { my $file = shift; unless(-f $file) { return("NO INDEX"); } local *HTML; local *_; open(HTML,"<$file"); while(<HTML>){ if(/<title>(.*)<\/title>/i) { return $1; } } return "Untitled"; } my $dir ="/usr/local/apache/htdocs/projects"; my $url ="http://mattwork.potsdam.edu/projects"; opendir(PRJD, $dir); my @dirs = readdir PRJD; closedir(PRJD); print "Content-Type: text/html\n\n"; print "<html><head><title>Project Index Page</title></head><body>\n"; print "<h1>Project Index Page</h1>\n"; print "<ul>\n"; for(@dirs) { if(/^\./) { next; } unless(-d "$dir/$_") { next; } my $file = "$dir/$_/index.html"; my $title = Get_Title($file); print "<li><a href=\"$url/$_/index.html\">$_</a>: $title\n"; } print "</ul></body></html>";

If you don't like the formatting, please don't change the tags. Instead, use CSS to choose different styles for the H1 and LI tags. You'll probably want a smaller H1 font, and you can remove or replace the bullets from the list, for example.