Hmmm ... one has to really start clutching at straws to come up with an explanation.
I wondered whether there might be something rendering the "." in "5.040" as garbage (in numeric context) - thereby causing 0 + "$version") to return "5".
But that should probably generate a "not numeric" warning - and it could (in theory) just as well be a bug in eval{} or require() or the ternary operator.
I look forward to hearing what the problem was ... if you ever find out.
Thanks for the heads up about the typo
You're welcome - I just hope it doens't turn out to be contagious.