Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have a box of a dozen doughnuts. I want to eat three of them, and still have a full box with a dozen when I'm done. Solution? You need another box. ;) In Perl, you need two arrays; one is the original, and one will be the copy, on which you can perform whatever manipulations you wish, without affecting the original.
There are infinite other strategies, but your question is vague enough to make it impossible to focus on which strategy would be optimal. Dave In reply to Re: How to substitute the elements in an array without changing the original array.
by davido
|
|