#!/usr/local/bin/perl -wT use strict; require "/home/scsfac/downeyt/public/scripts/parse-lib.pl"; my %query = get_query(); my (%chosen, @team, @errors); if ($query{team}) { @team = split("$;",$query{team}); foreach (@team) { $chosen{$_} = "selected"; } } if ($query{color}) { $chosen{$query{color}} = "checked"; } if (scalar %query) { if (@errors = findErrors()) { displayForm(@errors); } else { displayThanks(); } } else { displayForm(); } sub displayThanks { print < Thanks

Thanks

THANKS ; } sub displayForm { my (@errors) = @_; print < Enter Data FORM if (@errors) { print "
    \n"; foreach (@errors) { print "
  1. $_\n"; } print "
\n"; } print < Full name:
Please select a color: Red Blue Green
Please choose one or more teams: END ; } sub findErrors { my (@errors); if ($query{full} eq "") { push (@errors,"Full name must not be blank"); } if (@query{color} eq "") { push (@errors,"A color must be selected"); } if (@query{team} eq "") { push (@errors,"At lease one team must be selected"); } return @errors; }