http://qs321.pair.com?node_id=11125748

SergioQ has asked for the wisdom of the Perl Monks concerning the following question:

Oh help me please Holy Monks, this one is killing me.

I have an old pm module that does all the connecting and querying with MySQL, so I have faith in it.

Now I am trying to retrieve multiple rows with all columns using selectall_hashref and am tripping all over myself.

my $data_all =  $connection->selectall_hashref($query, { 'Columns' => {} } );

And I get back: Not an ARRAY reference at /usr/local/lib/x86_64-linux-gnu/perl/5.26.1/DBI.pm line 2106.

I know all the column names, this is not a read any strange table function.

Somewhere my approach has it all wrong, should I take a different approach?

What I am trying to get back is an array of hash references, that's al, to my multiple row query, and yes my query works manually.

Can you help me?

p.s. I found this thread <a href="https://www.perlmonks.org/?node_id=1040177 "target="_blank> How does DBI return an arrayref with key/value pairs? so I tried that, switching to selectall_arrayref

But when I ran

for my $row (@$data_all)<br> {<br> my %currec = $row;<br> foreach my $columns (keys %currec){<br> say $columns;<br> say $currec{$columns};<br> }<br> }

What I got back was that $columns was another hash, and that led my second "say" to output nothing.

So confused