use strict; use CGI; my $cgi=CGI->new; print $cgi->header; my @un_filled; foreach ($cgi->param) { unless($cgi->param($_)) { push @un_filled, $_; } } if(@un_filled) { print "You've forgotten to fill in the following fields: @un_filled"; exit; } # do stuff...