I think this is because fetchrow_arrayref uses the same location in memory every time, as the DBI docs state:
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. Also, the elements of the array are also reused for each row, so take care if you want to take a reference to an element.