my @sorted = qw( 02_org_name 03_org_addr1 03_org_addr2 04_org_city ... ); my %swip_data; my @missing; @swip_data{@sorted} = map { print "$_ :" . $cgi->textfield(-name => "$_") . "
"; defined $cgi->param($_) and $cgi->param($_) or push @missing, $_ and ''; } @sorted; @missing and print "You must define these fields: ",join(', ', @missing),".
\n";