in reply to Prototype mismatch error - ChangeNotify
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.
—John
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Prototype mismatch error - ChangeNotify
by merrymonk (Hermit) on May 23, 2011 at 07:30 UTC | |
by merrymonk (Hermit) on May 23, 2011 at 08:41 UTC | |
by John M. Dlugosz (Monsignor) on May 23, 2011 at 17:31 UTC | |
by John M. Dlugosz (Monsignor) on May 23, 2011 at 17:27 UTC |