in reply to overwriting references in a loop

It might make a bit more sense to just use hashkeys with in the second array.. i.e. $array1[0]{username}=$username etc. Also note that your pushing a refference to an array
$fetch1{array_ref} = \@array1;
This is pointing to @array1 specifically, if you just wanted an annonymous array, then drop the backslash, and (if you need to) surround it with parens.