|Just another Perl shrine
Re: Prototype mismatch error - ChangeNotifyby John M. Dlugosz (Monsignor)
|on May 20, 2011 at 13:20 UTC
The "prototype" is a declaration that a function will take arguments of a certain form. I think the error is saying that there are two conflicting declarations for INFINITE, normal and prototyped to take no arguments.
I suspect that INFINITE is a constant created via use constant, and might be declared differently in different modules. (I see it is an "XS constant" in Win32::ChangeNotify) That is, Win32::ChangeNotify might declare it one way and some other module declare it another way.
Move the Win32::ChangeNotify line higher up, so it happens first. Then the error will tell you the other place.
That will tell you exactly what the problem is. If that guess is right, you can find exports of INFINITE in two different .pm files.
Then you can post the details and module names and ask again for suggestions on remedying it. Perhaps one of the modules has it wrong and needs to be fixed. The modules in question might have a way to prevent the export. Or there may be general-purpose tricks to get around it but I don't know them off hand.
I notice from the source that ChangeNotify is exporting constants by default, without mentioning that in the documentation nor providing a way to prevent it. Using () after the use line will prevent the import function from being called, but I don't know if that will prevent it from doing other things that are necessary, too!
If the other place that imports it doesn't have a way to prevent it too, then a work-around would be to use it inside a dummy package. It is only used in one line, so delegate that line to a function in that inner package, which you call from the main code.
You should complain to the module author for having default exports.