in reply to Re^2: array to string
in thread array to string
What you've got there is an array reference with one element, which is another array reference with a single element. Change your code to this:
for my $total_info(@$Count) { print "$total_info->[0]\n"; }
In the for statement, you extract a single element of the array in a loop (the inner array reference). The print statement prints out the first element of the inner array reference.
Will you ever get more than one record returned per call? If not, you might consider not using fetchall_arrayref, as that's why you have an aref inside of a top-level aref. fetchall_* implies that you're expecting several records returned. If you only ever expect one piece of data returned per call, use fetchrow_arrayref.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: array to string
by davido (Cardinal) on Oct 13, 2020 at 19:47 UTC | |
|
Re^4: array to string
by jcb (Parson) on Oct 14, 2020 at 01:21 UTC | |
|
Re^4: array to string
by bigup401 (Pilgrim) on Oct 13, 2020 at 18:35 UTC |