my @customer_attributes = qw/firs_tname last_name phone email date Accept_Term comp_man comp_model comp_Model_Num/; my %customer; @customer{@customer_attributes} =(); # Now you have %customer populated with the keys as undef... require String::Prettify; for my $att (@customer_attributes){ printf "%s: ", String::Prettify::prettify($att); my $input = ; chomp($input); $customer{$att} = $input; }