From my understanding, one of the little idiosyncrasies of Makefile.PL/Build.PL installers (including MI variants of both) is that in order to make sure that the Makefile and Build use the correct perl installation, you should always be explicitly running M/B.PL with the perl you want to install the module with, and NOT necesarily with the default perl.

This is why installation instructions read

perl Makefile.PL
make
make test
make install

and not

./Makefile.PL
make
make test
make install

As a result, to help enforce this and prevent accidental usage of the installer as an executable, it seems to be (at least in the MI case) highly recommended that you M/B.PL file NOT be executable, and NOT contain a #!/usr/bin/perl line at the top.

This is specifically the sort of thing that Kwalitee is aimed at, a not-strictly-enforced but almost-always-recommended rule that many people might not be aware of, or might easily get wrong.

And it's easy to check with requiring the CPAN metadata or heavy-duty PPI parsing to acomplish.

I'd like to propose a Kwalitee test installed_not_executable be added for which you get the Kwalitee point if and only if:

1) Both Makefile.PL and Build.PL (if they exist) are not executable
2) Both Makefile.PL and Build.PL (if they exist) do not have a leading hash-bang line

What happens in the case with a pre-rolled Makefile I'm not entirely sure, or other modules that have neither of the files I'm not sure, but such a distribution hasn't strictly speaking made the mistake, so I'm not against given them the point.

Comments? Thoughts?

Adam K

Reply via email to