#!/usr/bin/perl $copyright = < EOL if($ENV{'QUERY_STRING'}){ print "Content-type: text/plain\n\n"; open(R, "./dai.cgi"); print while ; close(R); exit; } print "Content-type: text/html\n\n"; open(B, "./blist.txt"); while(){ chop; ($folder, $color, $title) = split(/,/); $color =~ s/!.*//; next if $folder =~ /^\./; print < $title EOF open(R, "./$folder/index.html"); while(){ last if //; } for($i=0;$i<20 && ($_ = );$i++){ last if //; s/(\d+\.html)/$folder\/$1/; print; } close(R); print "\n"; } close(B);