In python or C++ there is a concept called "deep copy". try to search that keyword on cpan, like this one: http://search.cpan.org/~stevan/Class-Cloneable-0.03/lib/Class/Cloneable.pm
On Fri, Mar 7, 2008 at 6:10 PM, Philipp Knechtle <[EMAIL PROTECTED]> wrote: > Hi > > > > I am working with subarrays in a main array. When I copy the main array: > > > > my @mainarray = ([1,2,3],[4,5,6],[7,8,9]) > > my @arraytwo = @mainarray > > > > the references get copied. When I then modify the subarray data in > @arraytwo they are of course also modified in @mainarray. > > > > So I use the command: > > > > push @arraytwo, [EMAIL PROTECTED] for @mainarray > > > > to copy the array. Is there a nicer way to do it? > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/