#!/usr/bin/perl use English; require "/home/supadm/public_html/enlightenment/cgi-bin/cgi-lib.pl"; $ret=&ReadParse; # Get prayer data: ($pledge is the person's name) $pledge= $in{pledge}; ucfirst($pledge); $city=$in{city}; $state=$in{state}; $country=$in{country}; $verse=$in{verse}; $verselist="/home/supadm/public_html/enlightenment/services/verses.dat"; $versepage="/home/supadm/public_html/enlightenment/services/prayer.html"; $originalprayer="/home/supadm/public_html/enlightenment/services/originalprayer.dat"; # Call the subroutine to print the tops of cgi screens: &printHeader; # Keep showing the form until an email address is received: unless(defined($verse)) { &printAddForm; exit; } else { # Once we get the goods, say goodbye: &printGoodbye; # Now scrutinize the little bastard: #&runSecurityCheck; # If it's OK, then the routine didn't die, and we add or remove the address: if(exists($in{submitpassword})) { &addToVerseList; &makeHtmlPage; } if(exists($in{submitunsubscribe})) { &removeFromVerseList; &makeHtmlPage; } } ################################################ # SUBROUTINE DEFINITIONS sub makeHtmlPage { open (INFILE, "<$originalprayer") or print "

Can't see the original prayer

"; @original=; close INFILE; open (INFILE, "<$verselist") or print "Help! I can't get the names to make the html page!

"; @stuff=; close INFILE; open (OUTFILE, ">$versepage") or print "Uh, oh. I'm sensing an impurity in the system. Please contact puritypolice\@supersaturated.com to report the infraction. We thank you for your support.

"; print OUTFILE "Prayer for The Heroes and Casualties of the September 11 Attack Find Enlightenment


add thoughts
"; foreach $line(@original) { print OUTFILE "$line\n"; } print OUTFILE "
"; foreach $thing (@stuff) { ($pledge, $city, $state, $country, $verse) = split /\|/, $thing; print OUTFILE "

$verse ($pledge, $city   $state   $country )
\n"; } print OUTFILE "

We regret that so many must be left unnamed, but we are with you. This is personal.

add your expressions of gratitude, hope, or remembrance

Find Enlightenment
"; close OUTFILE; chmod (0666, "$versepage"); } sub runSecurityCheck { die if($email=~/\\/ ||$email=~/\// || $email=~/\s-/ || $email=~/\*/ || $email=~/http:/ || $email=~/\!/ || $email=~/\|/ || $email=~/\s/ || $email=~/\&/ || $email=~/\`/ || $email=~/\.\./); # print "Ciao!

"; } sub printAddForm { =pod prints the html form that asks for the password and the username =cut print "

This page is provided to allow secular, non-religious expressions of gratitude and remembrance to the human beings who have helped and who were lost in the attacks on humanity committed on September 11, 2001. We request that prayers to supernatural beings be reserved for the millions of spiritual organizations already dedicated to such activities. However, all persons are invited to commend our human heroes and express sorrow for the victims.

Your name:
Your city:
Your state:
Your country:

"; } sub addToVerseList { open(INFILE, "<$verselist") or print "Can't look at the current list of readers. Please contact carolyn\@supersaturated.com

"; @pledgepeople=; close INFILE; open (OUTFILE, ">$verselist") or print "Please contact carolyn\@supersaturated.com for help: we couldn't add your address to the list.

"; #print back out the old verses: foreach $person(@pledgepeople) { next if !($person=~/\S/); chomp $person; print OUTFILE "$person\n"; } #put in the new verse: $verse=~s/\n/ /g; $verse=~s/
/ /g; $verse=~s/

/ /g; print OUTFILE "$pledge|$city|$state|$country|$verse|\n"; close OUTFILE; chmod (0666, "$verselist"); } sub printHeader { ## Print header: print "Content-Type: text/html\n\n"; print " add your expressions of gratitude, hope, or remembrance

think of our heroes and people lost

"; } sub printGoodbye { =pod foreach $key (keys %in) { print "$key => $in{$key}

"; } =cut print"

Thanks for your thoughts.

Read Our Prayer "; }