in reply to Re^6: Prototypes required even after mocking a sub
in thread Prototypes required even after mocking a sub

It doesn't; as mentioned in the other thread it may compile against the original sub before it even gets to the prototype, as prototypes are used in the parsing phase. For example, the prototype ($) completely changes the meaning of this code: my @results = (foo 3, 5); If foo has a prototype of ($) then it will be executed as my @results = (foo(3), 5); rather than "slurping" up all the arguments available to it. This means that the parser constructs a completely different optree in this case. Overriding foo after that has been parsed doesn't change that.