my @sorted = qw( 02_org_name 03_org_addr1 03_org_addr2 04_org_city ... ); my %swip_data; @swip_data{@sorted} = map { defined $cgi->param($_) and $cgi->param($_) or print "You must define a $_.
" and '' } @sorted; #### 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"; ##
## if (defined $cgi->param("$_")) { #### print "You must define a $_." . "
"; print "You must define a $_.
"; # less noise ##
## print <