in reply to Pushing Array ref to array
Another thing to watch out for, with code like this ... another compelling reason to use tightly-scoped my variables ... is that you do not want references to be “left over.” Not outside the loop, after it’s over, and especially not from one loop iteration to the next.