%hash = %$hashref; # or to get at a specific value: $value = $hashref->{key}; # or you can use fetchrow_arrayref: my @names = @{$sth->{NAME_lc}}; my %hash; while (my $values = $sth->fetchrow_arrayref) { @hash{@names} = @$values; }