Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Prototypes required even after mocking a sub

by Anonymous Monk
on Sep 21, 2018 at 20:28 UTC ( [id://1222810]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found