foreach $key (@FieldNames) { my $val = ( defined( $FORM{$key} ) and $FORM{$key} =~ /\S/ ) ? $FORM{$key} : "BLANK"; print LOGFILE "\t$val"; }