david.jackson has asked for the wisdom of the Perl Monks concerning the following question:
I would appreciate any advice on how to imput this script, it pretty basic,send email and creates a file called server.log.
Furture goals include: 1) DBM and or Storble for data storage Thanks for your time.
#!/usr/bin/perl -wT use strict; use diagnostics; use CGI qw(:all); # my $GUESTBOOKFILE="/tmp/server.log"; # print header(); print start_html(-title=>'The Light Dawns'); print h4("Take the parms and run"); print p("Node Name: ") . p(param('hostess')); print p("IPAddr: ") . p(param('ipaddr')); print p("PrimarySA: ") . p(param('primarysa')); print p("Funcition: "); print p(param('funct')); print "end_html"; # Fire off email # open (MAIL,"|/var/qmail/bin/qmail-inject"); print MAIL "To: <davej\@pickledbeans.com>\n"; print MAIL "From <bitbucket\@pickledbeans.com>\n"; print MAIL "Subject: " . param('hostess') . " Report\n"; print MAIL "Node Name: " . param('hostess') . "\n"; print MAIL "IP Addr: " . param('ipaddr') . "\n"; print MAIL "Primary SA: " . param('primarysa') . "\n"; print MAIL "Function:\n"; print MAIL param('funct') . "\n"; close MAIL; print end_html(); my ($date); open (LOG,">>$GUESTBOOKFILE"); flock(LOG, 2); #print LOG join(":",$date,param($_)) ."\n"; #save_parameters(*LOG); print LOG join(":",param('hostess') , param('ipaddr'), param('primarysa'), param('funct')); print LOG "\n"; close (LOG); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rev: CGI backup
by Masem (Monsignor) on Oct 17, 2001 at 22:43 UTC | |
by Anonymous Monk on Oct 17, 2001 at 23:49 UTC |