Subject: | INIT block in Win32::API::Type seems not to be invoked on nested 'use' |
Tested on Perl 5.6.1 / 5.8.5 / 5.8.6 with the same result.
bar.pm:
=======
use Win32::API;
Win32::API->Import("kernel32", "int GetCurrentProcessId()");
1;
=======
C:\>perl -e "use bar"
Win32::API::parse_prototype: WARNING unknown output parameter type 'int' at C:/Perl/site/lib/Win32/API
.pm line 273.
But perl -e "do bar.pm" runs ok.
Further investigation shows that INIT block in Win32::API::Type (where 'parameter types' are defined) is NOT executed if Win32::API is used in a module which is in turn used in another module (sorry for a long statement).
Possible workaround is to remove 'INIT' label in Win32::API::Type and make this block just a bare block.