laziness, impatience, and hubris | |
PerlMonks |
This is really a Perl BUG with my?! Need some advice...by gmpassos (Priest) |
on Jan 24, 2004 at 04:10 UTC ( [id://323782]=perlquestion: print w/replies, xml ) | Need Help?? |
gmpassos has asked for the wisdom of the Perl Monks concerning the following question:
When I was making some tests of Class::HPLOO, where multiple documents are filtered in the same process, I found a very strange bug, that only happens if you use my and recursivity in a strange way.
Soo, I tried to isolate the bug and make sample of it: The BUGGED output is: But the right output should be: And to produce the right output I have just changed one line of the code:
Soo, why this happens? It seems that my() creates the same scalar 2 times? Or the scalar is not destroied after end the scope of the sub? Or this is a optimization bug? I think that this is a reference count bug, but I haven't looked the Perl CORE yet to really say that. Note that the bug only happens if the interpolation exists, that is made by: I saw the bug first on Perl-5.6.1, than I saw it on Perl-5.8.2 and Perl-5.8.3 too. Soo, wasn't patched yet! I will wait some advices from the monks before send it to perlbug...
Graciliano M. P.
Back to
Seekers of Perl Wisdom
|
|