![]() |
|
P is for Practical | |
PerlMonks |
Re: DBI: select distinct returns same valuesby Anonymous Monk |
on Sep 21, 2019 at 14:19 UTC ( #11106491=note: print w/replies, xml ) | Need Help?? |
You might try replacing push( @all_rows, $ref ); with push( @all_rows, [ @$ref ] );. The DBI docs for fetchrow_arrayref() say "Note that the same array reference is returned for each fetch, so don't store the reference and then use it after a later fetch.". The [ @$ref ] effectively does a shallow clone of $ref, so you should get distinct values again. Of course, if it were me I would push $ref->[0], and then in the following foreach loop just print "$row_ref\n";.
In Section
Seekers of Perl Wisdom
|
|