in reply to
Best way to copy an array?
For non-huge arrays, this should work fine:
@newlist = @{$self->{oldlist}};
[download]
This will copy the elements but not alias them: i.e., it will make 2 separate arrays that happen to start out with the same elements.
Code is (almost) always untested.
http://www.justicepoetic.net/
Comment on
Re: Best way to copy an array?
Download
Code
In Section
Seekers of Perl Wisdom