Possible Duplicate:
What's the best way to make a deep copy of a data structure in Perl?
In my code i do:
@data_new=@data;
and then I change @data
.
The problem is that @data_new
always changes as well.
It's like @data_new
is just a reference to what's in @data
.
How do i make a copy of an array which is not a reference but a new copy of all the values?
@data
is a two dimensional array, by the way.