in reply to DBI question

This behaviour is documented in the DBI documentation for fetchrow_arrayref:

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.

Replies are listed 'Best First'.
Re^2: DBI question
by Herkum (Parson) on Mar 07, 2008 at 21:12 UTC

    To further expand upon what Corion pointed out, it is always returning the same array reference, the question is why?

    The point of using the fetchrow_* is to allow the programmer to reduce their memory footprint by limiting the amount data (and therefore memory) be accessed. One of the ways it does this is to return the same array reference for each 'fetch' instead of generating and returning a new array (and an associated array reference) for each row.

    If you did not care about memory management than you could use 'selectall_arrayref()' instead.