Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Does an installer alter the #! path on a script?

by boftx (Chaplain)
on Nov 25, 2013 at 01:01 UTC ( #1064165=perlquestion: print w/ replies, xml ) Need Help??
boftx has asked for the wisdom of the Perl Monks concerning the following question:

I don't usually put a script in a package, so I'm not sure how the installer handles this. Typically, one would see the following in a perl script:

#!/usr/local/bin/perl

But suppose the perl executable is located somewhere else? How does one tell the installer (cpanm, CPAN, etc.) to change the #! path in the script? (I am presuming that script in a distro's bin dir will be installed in an appropriate location in the installing user's PATH.)

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Comment on Does an installer alter the #! path on a script?
Select or Download Code
Re: Does an installer alter the #! path on a script?
by davido (Archbishop) on Nov 25, 2013 at 01:04 UTC

    For a module/script author to accomplish this you design your makefile properly. To read up on the topic, open the POD for ExtUtils::MakeMaker in your browser. Search the text for #!. It's covered there:

    EXE_FILES

    Ref to array of executable files. The files will be copied to the INST_SCRIPT directory. Make realclean will delete them from there again.

    If your executables start with something like #!perl or #!/usr/bin/perl MakeMaker will change this to the path of the perl 'Makefile.PL' was invoked with so the programs will be sure to run properly even if perl is not in /usr/bin/perl.


    Dave

      Thanks. I was just about to post and update saying I had found that comment. :(

      It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

        Thanks. I was just about to post and update saying I had found that comment. :(

        :)smile , now install #! and install shebang yields results :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1064165]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-08-30 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls