I was writing some very simple unit tests last night and was baffled when one didn't work.
The code was very simple, something I thought I had done hundreds of times:
It's not the same thing, but it seems similar to me.
Unfortunately the commit that fixed Brian's bug 93548 does not fix this one.
I refactored the problem down to a pretty small sub,
and am further baffled by the minor variations that cause the problem to go away.
Here is the script and the output from various perls...
Interestingly this test appears to include another bug that was fixed somewhere between 5.10 and 5.12...
Can anybody make sense of this?
Am I missing something?
Or is this a legitimate perl bug?
UPDATE:
I should add that, in my original function,
I added a warning to the getline method on the object so that I could tell that it was in fact getting called (inside the do-block), but somehow undef was still being returned in the end.
This perl bug has been fixed. See follow-up post.