#!/usr/bin/perl -w use strict; use CGI qw(:standard); my $progid = param('progid'); if ($progid == "entry") { print "Content-Type: text/html\n\n"; open FH, "entry-pool.dump" or die $!; my $SEP = "--------"; local $/ = $SEP; my $line = ; while () { $line = $_ if rand($.) < 1; } close FH; $_ = $line; s!^\s*!!; s!$SEP\s*$!!; tr!\cM!!d; my($title, $link, $excerpt) = split /\n/, $_, 3; print <$title
$excerpt HTML } elsif ($progid == "desc") { require "desc.conf"; open (FILE, my $random_file); my @LINES=; close(FILE); srand; print "Content-type: text/html\n\n$LINES[int rand(@LINES)]\n"; } elsif ($progid == "bush") { require "bush.conf"; open (FILE, my $random_file); my @LINES=; close(FILE); srand; print "Content-type: text/html\n\n$LINES[int rand(@LINES)]\n"; }