#!/usr/bin/perl -w ## Generate blog for Save Uncle Sam umask 0000; use strict; use CGI; my $query = new CGI; my @keys = $query->param; my $weblog = "sus.blog"; my $remoteaddr = ""; my $email = 'bystrc@rpi.edu'; my $listener = 'bystrc@rpi.edu'; my $comment = "no comment entered"; my $hw_dir = ""; print "Content-type: text/html\n\n"; print '' . "\n"; if (@keys == 0) { print "No Input from the form."; } else { $remoteaddr = $ENV{'REMOTE_ADDR'}; $email = $query->param('email'); $comment = $query->param('comment'); } if ($weblog eq "") { print "Blog name was not specified.

\n"; } else { print "

\n\n" ;
  open(BLOG, "$weblog") ||
    &epitaph( "ERROR: weblog file open failed." ) ;
  while () {
   ## diagnostic
    print $_;
  }
  close(BLOG) || die "Trying to close BLOG \n";
}

  open(BLOG, ">>$weblog") ||
    &epitaph( "ERROR: weblog file open failed." ) ;
  print "
\n"; print "

\n"; print BLOG "EMAIL:: $email \n"; print "

EMAIL:: $email connected from $remoteaddr \n"; print BLOG "COMMENT:: $comment \n"; print "

COMMENT:: $comment \n"; print '' . "\n"; close(BLOG) || die "Trying to close BLOG \n"; exit; sub epitaph { print "

@_ \n"; die " @_ "; return 0; } exit;