Am Mo 11. Apr 2016, 12:40:59, ETHER schrieb:
Show quoted text> On 2015-05-30 14:39:02, ETHER wrote:
> > This came up in the context of packaging the distribution for BSD --
> > .pm and .pod files are not executed, therefore do not need a shebang.
> > /bin/false clearly isn't the correct executable anyway -- what was
> > the
> > intent here?
>
>
> Ok.
> It seems a strange thing to do, since .pm files are not ever invoked
> directly except manually on the command line (and who would do
> that?!), but if it makes you happy, go for it.
I have seen systems where a double-click on .pm file executed them via /bin/sh. And a web server may execute them, when configured naively. Using /bin/false as the she-bang argument is a standard way of preventing such things.
Show quoted text>
> Do keep in mind though that the other possibility for invoking the
> module is "perl Foo.pm".
And perl will then terminate with a non-zero exit code which is exactly what I intend.
Show quoted text> This is what compile tests test (and can be
> set up automatically in your distribution via
> Dist::Zilla::Plugin::Test::Compile, a dzil plugin I'm proud to help
> maintain).
If I see it correctly then your Dist::Zilla::Plugin::Test::Compile invokes the module with the "-c" command-line switch, and that works as expected. It is the rationale behind that shebang line: Allow only compile-time checks but do not execute the file because of possibly unwanted and unforeseen side effects.