Subject: | Makefile.PL: win32 check has to be in a BEGIN block |
Currently the win32 check on top of Makefile.PL is ineffective. On a linux system:
$ perl5.24.3 Makefile.PL
Warning: prerequisite Win32::TieRegistry 0.03 not found.
Generating a Unix-style Makefile
Writing Makefile for Win32::Env::Path
Writing MYMETA.yml and MYMETA.json
Problem is that "use inc::Module::Install::DSL" and the dsl processing is done during compile time, while the win32 check happens at run time, which is never reached (because of the "exit 0" in Module::Install::DSL's import function). Probably the fix is to put the win32 check code into a BEGIN{} block.