You misunderstood the question, just like dws did. I didn't get it until just a few moments ago either. Ovid's question is not "why does this not work as initially expected", nor "why do I get this warning", it is "why do I get the warning sometimes".
In your example, if you change print scalar(4,5); to print scalar(0,1);, you will get no warnings. His question is why and when that happens.
As chromatic quotes the perl source, that's the case because the warning is kludged not to trigger for the two values 0 and 1.
____________Makeshifts last the longest.