#!/usr/local/gnu/bin/perl use CGI qw(:standard); print < END $regfile = '../public_html/perl/registrations.tsv'; $name = param('name'); $email = param('email'); $food = param('food'); open(REG,">>$regfile") or fail(); print REG "$name\t$email\t$food\n"; close(REG); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); $now = sprintf "%4d-%02d-%02dT%02d:%02dZ\n", 1900+$year,$mon+1,$mday,$hour,$min; print <Thank you!

Thank you!

Your fake registration to Virtual Nonsense Party has been recorded at $now as follows:

Name: $name

E-mail: $email

Food preference: $food

END sub fail { print "Error", "

Error: cannot record your registration!

"; exit; }