tobyink / p5-crypt-xkcdpassword

0 stars 3 forks source link

Please remove env from the shebang #5

Open tobyink opened 3 years ago

tobyink commented 3 years ago

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 commented 3 years ago

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.