http://www.perlmonks.org?node_id=330844


in reply to DBI fetchrow_hashref issue

Aside from the specific problem in your code, what you want to achieve an also be done with:

my @case = @{$sth->{NAME}}; while(my $info = $sth->fetchrow_hashref) { for (@case) { print "$_ => $info->{$_}\n"; } }

I recommend reading DBI Recipes, which deals with several issues related to fetching hashrefs from a database.

BTW, the probable reason for your mistake is that you are not using strict.