in reply to Prototypes required even after mocking a sub

The prototype is used by the parser itself to validate the number of parameters at compile time. It's likely your mocked override was not installed before this happened, if it was installed at runtime.
  • Comment on Re: Prototypes required even after mocking a sub

Replies are listed 'Best First'.
Re^2: Prototypes required even after mocking a sub
by stevieb (Canon) on Sep 21, 2018 at 20:35 UTC

    Thank you.

    I did some preliminary and very basic quick tests to do the work in the compile phase, but to no avail. I will put more effort into seeing how I may be able to do this.

      A recent thread 1215668 discussed the difficulty of overriding a function called by a module. The solution required executing the override before compiling the module. The details may apply to your problem.
      Bill
      In order for it to happen in the compile phase, the user must call your code (both loading your module and executing the sub override) in that file's compile phase, e.g. in a BEGIN block or use declaration.