#!/usr/bin/perl -w #entry.cgi use CGI qw/:standard/; use FileHandle; print header, start_html('Title goes here');#feel free to change this if (!param) { print h1('header goes here'), start_form(-action=>""), "Enter name here", textfield('name')," i.e. andy selby", p(), "Enter your email addy if different from your name", textfield('email'),"\@youremailaddress.com", p(), "Monday",popup_menu(-name=>'monday', -values=>['yes','no','probably','preferred']),#feel free to suggest more p(), "Tuesday",popup_menu(-name=>'tuesday', -values=>['yes','no','probably','preferred']), p(), "Wednesday",popup_menu(-name=>'wednesday', -values=>['yes','no','probably','preferred']), p(), "Thursday",popup_menu(-name=>'thursday', -values=>['yes','no','probably','preferred']), p(), "Friday",popup_menu(-name=>'friday', -values=>['yes','no','probably','preferred']), p(), "Saturday",popup_menu(-name=>'saturday', -values=>['yes','no','probably','preferred']), p(), "Sunday",popup_menu(-name=>'sunday', -values=>['yes','no','probably','preferred']), p(), submit, end_form; }else{ open (OUT, ">>availability.csv") or die "$!";#output to csv file print OUT join ",", map { param($_) } qw/name email monday tuesday wednesday thursday friday saturday sunday/; print OUT "\n"; p(), close OUT; } print "click here to view results";#redirect doesn't work, keeps 302'ing print end_html; #################################################### #!/usr/bin/perl -w #display.cgi use strict; use warnings; use CGI qw/:standard :html3/; print header; print start_html('title goes here');#feel free to change this title print h1('header goes here'); print CGI::start_table(); print caption('The Following people are available thus'), print TR({}, th([ 'Name', 'Email', 'Monday', 'Tuesday', 'Wednesday', 'Thursday','Friday', 'Saturday', 'Sunday' ]), ); open(my $DOC, "<", "availability.csv") or die "$!"; while(<$DOC>) { chomp; my @fields = split /\s*,\s*/; print TR({}, td([ $fields[0], $fields[1], $fields[2], $fields[3], $fields[4], $fields[5], $fields[6], $fields[7], $fields[8] ]), ); } close $DOC; print CGI::end_table(); print end_html();