The stupid question is the question not asked | |
PerlMonks |
Local Copy of a member variableby benrwebb (Scribe) |
on Oct 20, 2005 at 17:02 UTC ( [id://501734]=perlquestion: print w/replies, xml ) | Need Help?? |
benrwebb has asked for the wisdom of the Perl Monks concerning the following question:
Here is my situation: I'm inside a method. I access a local variable (a hash ref), munge the hash and then return my munged data. The problem comes in that I seem to be munging my member variable as well. I need to work with a local copy so that the member variable is uncorrupted. Here is my current (broken) code:
What do I need to do to make manipulating %atlas non-destructive to $self->{atlas} ? Thanks!
Back to
Seekers of Perl Wisdom
|
|