in reply to array/hash - reference and dereference

If you're trying to do a SQL insert based on a hash, SQL::Abstract may work for you.

use SQL::Abstract; my $abstractor = SQL::Abstract->new(); my %value_of = ( name => 'Martin', age => 28 ); my ($stmt,@bind) = $abstractor->insert( 'table', \%value_of ); $dbh->do( $stmt, undef, @bind );

If you want to make a hash with keys and not values, that doesn't make sense, as fullermd says. You can, however, easily get a hash with all values set to undef like so:

my %h; @h{@keys_wanted} = ();