good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
tie(...) bug or select(...) bug?by SankoR (Prior) |
on Oct 04, 2013 at 18:22 UTC ( [id://1056913]=perlquestion: print w/replies, xml ) | Need Help?? |
SankoR has asked for the wisdom of the Perl Monks concerning the following question: While trying to clear up a few older bugs in a module I'm planning to take over, I found one I can't seem to wrap my head around. Take this:
Tie::StdScalar is part of Tie::Scalar and does virtually nothing so parsing that mentally should result in a .25s sleep and then exit. But it doesn't. The code blocks as if $SLEEP_TIME was undefined. However, this...
...works exactly as expected. The value of $SLEEP_TIME is printed and then select(...) sleeps a quarter second. According to Devel::Trace, my first example never calls the tied scalar's FETCH method but in my second example, it's correctly called twice: once for the print and again in the select statement. I only have perl v5.16.3 installed so I'm not sure if this is a newly introduced bug or an old one. Before I bother fending off the dragons that inhabit p5p, anyone else have an idea or see this same behavior with newer/older versions of perl? Update: Reported as RT#120102.
Back to
Seekers of Perl Wisdom
|
|