gaspodethewonderdog has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that I am creating a 'my' variable within my own personal scope within the curly braces and somebody is twiddling with my data. I had always hoped this wouldn't happen but it has. I asked the engineer's solution and he said to change the variable's name to make sure there wasn't any name collisions in the lookup table.
Hmmm... I thought constructs like my/local were supposed to prevent that? Silly me I guess. So now I am more than a little curious if there is a time when a variable declared with my really isn't getting new memory declared in the lookup table.
I would go play with the code and try using local to see if replacing the variable on the stack changed the behavior of the program but this is production code and I'd rather not be the one hosing things, especially since there is no formal test environment other than production for this.
I'm not looking for an explanation of how my works, but maybe I do because at a fundamental level the way I consider it works is wrong.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: When is my variable not really mine?
by merlyn (Sage) on Sep 07, 2000 at 17:39 UTC | |
by gaspodethewonderdog (Monk) on Sep 07, 2000 at 17:49 UTC | |
by Fastolfe (Vicar) on Sep 07, 2000 at 17:57 UTC | |
by gaspodethewonderdog (Monk) on Sep 07, 2000 at 19:03 UTC | |
by jcwren (Prior) on Sep 07, 2000 at 19:07 UTC | |
|
(Ovid) Re: When is my variable not really mine?
by Ovid (Cardinal) on Sep 07, 2000 at 18:46 UTC | |
|
RE: When is my variable not really mine?
by spudzeppelin (Pilgrim) on Sep 07, 2000 at 18:57 UTC | |
by Fastolfe (Vicar) on Sep 07, 2000 at 19:22 UTC |