in reply to looping hash

Untested, but it should be a place to start:

@keys = @{$sth2->{NAME}}; print join "\t", @keys; print "\r"; while ($record = $sth->fetchrow_hashref()) { print join "\t", map { $record->{$_} } @keys; print "\r"; }

Replies are listed 'Best First'.
Re^2: looping hash
by ibra (Novice) on Mar 07, 2012 at 16:33 UTC
    Thanks for the reply I Manage to figure it out below.
    my $Val=""; while ( my $dat_ref = $sth2->fetchrow_hashref("NAME_lc") ) { foreach my $val(@eachCols) { $Val = $dat_ref->{$val}; } }