in reply to fetchrow_hashref Confusion

How to I get at the hash it's self and not the reference?

The same way you work with any other hash ref:

%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; }