Skip Menu |

This queue is for tickets about the libintl-perl CPAN distribution.

Report information
The Basics
Id: 104811
Status: rejected
Priority: 0/
Queue: libintl-perl

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: unneeded shebangs in .pm and .pod files
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?
Am Sa 30. Mai 2015, 17:39:02, ETHER schrieb: Show quoted text
> 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?
It prevents them to be executed stand-alone, because I don't test what happens in that case. Is a WONTFIX a problem for you?
On 2015-05-30 14:39:02, ETHER wrote: Show quoted text
> 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. Do keep in mind though that the other possibility for invoking the module is "perl Foo.pm". 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).
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.
Not a bug.