http://www.perlmonks.org?node_id=125184


in reply to Help with creating and passing of an array...

I think I found your problem

The array @PER_Data; is outside of the while loop. This means that it is not going to be destroyed until the program ends. So the line

push @major_PER_Data, \@PER_Data;
pushes the same reference over and over again. Then the next time through the modification overwrites the data you thought you saved.

you can fix this by either moving the declaration of @PER_DATA inside the while loop or by changing the above line to

push @major_PER_Data, [@PER_Data];

Hope this helps,
Ira,

"So... What do all these little arrows mean?"
~unknown