#!/usr/bin/perl -w use strict; use CGI qw( :standard :html3 ); my @keys = qw( name email item ); my %labels = ( name => 'Name', email => 'Email Address', item => 'Item(s)' ); print header; print start_html('-title' => 'Raleigh Perl Mongers: August Meeting Sign Up', '-bgcolor' => 'white'); # See if we have data to store. my $store = 1; for my $key (@keys) { my $val = param($key); $val = '' unless defined $val; Delete($key); $val =~ s/\cM//g; $val =~ s/^\s+//; $val =~ s/\s+$//; param($key, $val); } for (@keys) { $store = 0, last if param($_) =~ /^\s*$/; } # If so, store it. if ($store) { if (-s '/export/home/raleigh/august-signup.txt' > 100_000) { print p(qq^We've been spammed... Please tell John, ASAP.^); exit 0; } if (!open FH, '+Couldn't modify signup file: $!
\n"; } else { flock FH, 2; seek FH, 0, 0; my $keep = 1; LOOP: while (The idea for August's meeting is to sit around and chit-chat, while consuming soft drinks and munchies.
Please put your name, email address and a brief description of the item or items you'll be bringing, below, then hit "Submit". An attempt is made to make your address a bit harder for spammers to steal, should that be a concern (see the current list, below, for details).
Thanks!
| Name | Email Address | Item(s) |
|---|