note
Anonymous Monk
<p>You might try replacing <code>push( @all_rows, $ref );</code> with <code>push( @all_rows, [ @$ref ] );</code>.</p>
<p>The <a href="https://metacpan.org/pod/DBI">DBI docs</a> for <a href="https://metacpan.org/pod/DBI#fetchrow_arrayref">fetchrow_arrayref()</a> say <strong>"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."</strong>.</p>
<p>The <code>[ @$ref ]</code> effectively does a shallow clone of <code>$ref</code>, so you should get distinct values again. Of course, if it were me I would push <code>$ref->[0]</code>, and then in the following <code>foreach</code> loop just <code>print "$row_ref\n";</code>.
11106471
11106471
14