Here is a direct quote from Programming the Perl DBI, Decartes and Bunce, O'Reilly, Page 223 Section fetchrow_arrayref.

'Note that the same array reference will currently be returned for each fetch, don't store reference and then use it after a later fetch'

In other words you are getting a shallow copy of row array instead of the deep copy you want/need. ( of course this what you have already discovered :( ).

Why not dereference rowarray_ref and simple store and array of arrarys.

... push(@entries, [ @$colunms_ref ]); ...

Update
'Holy Flatlander Chips' bwana147 caught a my baadddd very baddd deref causing column_ref flating out. I can't claim a typo on this one folks I just plain forgot :(. thx bwana147.

In addition after a short CB discussion with davorg we reach a consensus of two that this could all be resolved by simply using fetchrow_array and avoiding all his pesky derefencing.

mitd-Made in the Dark
'My favourite colour appears to be grey.'


In reply to Re: Multiple references pointing to the same memory location by mitd
in thread Multiple references pointing to the same memory location by ezekiel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.