NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Hmmm... (Score:2)
--rjray
Re:Hmmm... (Score:2)
Trust me. Once you see the bug, it's a forehead slapper -- if you've encountered this behavior before. It's something that folks often miss because it occurs so rarely, but it's a natural consequence of how Perl behaves.
D'oh! (Score:2)
--rjray
Re:D'oh! (Score:2)
Yeah, I know. It bit me, too :)
Yeah (Score:1)
Lbh'er zbqvslvat gur inyhrf bs gur cnenzrgre yvfg juvpu ner nyvnfrq gb gur inyhrf bs gur inevnoyrf va gur pnyyre'f fpbcr, gurersber zbqvslvat gur pnyyre'f fpbcr, be va guvf pnfr, "ernq-bayl inyhrf".
Of course, your tests should have found this instantly, if you used something like the examples you have there, as it throws up an immediate error.
Why does Perl do this? It's bitten me in the ass a few times, and I can't seriously imagine using it deliberately in code to be maintained.
Re:Yeah (Score:2)
Right in one! Fortunately, the fix is trivial, but it's strange to see if folks don't know what's going on, so I document it.
Re:Yeah (Score:1)
I believe Larry also considers this to be a mistaken feature: in Perl 6
sbenyvnfrf ner ernq-bayl ol qrsnhyg, which would've avoided this bug.(The bit in italics is a spoiler for the original question, so I've put it in Welsh ... erm, I mean rot-13.)
Smylers