It took me forever to figure it out, but here is what is happening with your code. The ternary operator ( - ? - : - ) is not being interpreted as you think it is. If you add parentheses, the behavior goes away:

yah, once again precedence rears its ugly head and cuts us down at the knees.

I lumped in wantarray with the ternary operator, to get what I thought was the wantarray operation... not so though hey. So that was what was happening. Glad you had fun working that out, I had fun constructing it.