reaction has asked for the wisdom of the Perl Monks concerning the following question:
... thanks again, reaction#!/usr/bin/perl ######################################## ## INITIALIZE CGI ###################### ######################################## use lib qw(.); use CGI; use CGI::Carp qw(fatalsToBrowser); $cgi = new CGI; ######################################## ## MAIN ################################ ######################################## $DATAFILE = "hitcount-sendtoevery.txt"; $WEBPAGE_INITIALIZE = "<html><body bgcolor=\"#000000\" text=\"#ffffff\ +" link=\"#ffffff\" vlink=\"#ffffff\" alink=\"#ffffff\"><font face=\"A +rial\" color=\"#000000\"><center><table border=\"0\" width=\"400\" ce +llspacing=\"20\" cellpadding=\"20\"><tr><td><center><h5>"; $WEBPAGE_SHUTDOWN = "</h5></center></td></tr></table></center></font>< +/body></html>"; $val = 0; open(RECORD, "$DATAFILE") or error_page_exit("Could not open datafile" +); $val = $_; close(RECORD); $val++; open(RECORD, ">$DATAFILE") or error_page_exit("Could not open datafile +"); print(RECORD, $val); close(RECORD); print $cgi->header(); print $WEBPAGE_INITIALIZE; print "Your download will begin automatically...(not working yet!)"; print $WEBPAGE_SHUTDOWN; ######################################## ## EXIT ################################ ######################################## exit; ######################################## ## ERROR ############################### ######################################## sub error_page_exit { print $cgi->header(); print $WEBPAGE_INITIALIZE; print "ERROR - Reason: "; print shift; print $WEBPAGE_SHUTDOWN; exit; } ######################################## ## END OF FILE ######################### ########################################
Edited by Chady -- retitled from 'noob question'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI script makes Internal Server-error
by davido (Cardinal) on Aug 29, 2004 at 17:23 UTC | |
by reaction (Acolyte) on Aug 29, 2004 at 17:26 UTC | |
by bronto (Priest) on Aug 30, 2004 at 10:33 UTC | |
|
Re: CGI script makes Internal Server-error
by jdporter (Paladin) on Aug 29, 2004 at 17:43 UTC | |
|
Re: CGI script makes Internal Server-error
by DamnDirtyApe (Curate) on Aug 29, 2004 at 22:48 UTC |