Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove env from the shebang #5

Open
tobyink opened this issue Jan 9, 2021 · 1 comment
Open

Please remove env from the shebang #5

tobyink opened this issue Jan 9, 2021 · 1 comment

Comments

@tobyink
Copy link
Owner

tobyink commented Jan 9, 2021

Migrated from rt.cpan.org #103288 (status was 'open')

Requestors:

From andk@cpan.org (@andk) on 2015-04-03 12:23:22
:

I don't know why it is so wide-spread that people have env in the shebang line. Maybe because nobody complains because 99% of the users have only one perl? I have another pending ticket that getw warnocked (https://rt.cpan.org/Ticket/Display.html?id=88661)

Here is the user story how this is unfortunate:

% /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase
Can't locate Crypt/XkcdPassword.pm in @inc (you may need to install the Crypt::XkcdPassword module) (@inc contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.0 /usr/local/share/perl/5.20.0 .) at /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase line 8.
BEGIN failed--compilation aborted at /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase line 8.

See, all searched paths are 5.20, but I called a 5.21.10. So I must write:

% /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/perl -MCrypt::XkcdPassword -E 'say Crypt::XkcdPassword->make_password'
superficial bite lawyer discussion

So here is the culprit:

% head -1 /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase
#!/usr/bin/env perl

Let me remove the env part and write the full path to my perl there. This work would be done by MakeMaker if env would not overrule it.

% head -1 /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase
#!/home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/perl

Now it works:

% /home/src/perl/repoperls/installed-perls/perl/v5.21.10/165a/bin/passphrase
programming dollars truman prevent

Heh, this program regularly makes password setting so essential:)

Thanks,

@tobyink
Copy link
Owner Author

tobyink commented Jan 9, 2021

From srezic@cpan.org (@eserte) on 2015-04-03 13:53:45
:

On 2015-04-03 08:23:22, ANDK wrote:

I don't know why it is so wide-spread that people have env in the
shebang line. Maybe because nobody complains because 99% of the users
have only one perl?

Or people use perlbrew for their custom perls, and get a customized PATH where the env trick works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant