I thought that doesn't copy anything, but aliases the array. You mean I'm copying a list every time I dereference it?!
No, 'cause push @{$self->{oldlist}}, $x does indeed modify the thing being remembered by self.
Ah, assigning to a @list naturally copies the elements and keeps the identity of the left-hand-side. That makes sence.
Thanks,
—John
In reply to Re: Re: Best way to copy an array?
by John M. Dlugosz
in thread Best way to copy an array?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |