Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Creating installable scripts

by bronto (Priest)
on Aug 12, 2003 at 16:40 UTC ( #283258=perlquestion: print w/ replies, xml ) Need Help??
bronto has asked for the wisdom of the Perl Monks concerning the following question:

Hello

I'd like to have something similar to (or even a) Makefile.PL to install a script --not a module--. I remember that I read somewhere that scripts with the .PL extension had something special in producing a new script with the correct "#!" line, but I can't recall where I found it.

In short, I'd like to do something like

perl myScript.PL

and have a runnable version of my script back, or

perl Makefile.PL ; make ; make install

and have a runnable version of my script installed in a sensible location

Can anybody point me to the right direction?

Thanks in advance

Ciao!
--bronto


The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz

Comment on Creating installable scripts
Select or Download Code
Re: Creating installable scripts
by particle (Vicar) on Aug 12, 2003 at 17:44 UTC

    if i understand you correctly, PAR might just help. have a look. it might not be the exact solution, but it lets you execute your script on any machine, even those without perl installed.

    ~Particle *accelerates*

Re: Creating installable scripts
by liz (Monsignor) on Aug 12, 2003 at 18:18 UTC
    Check out "EXE_FILES" in ExtUtils::MakeMaker. From the documentation:
    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.

    Whenever I need to have scripts installed, I just put them in the "scripts" directory and add:

    EXE_FILES => [<script/*>],
    to the call to ExtUtils::MakeMaker's "WriteMakefile".

    Liz

      BINGO!

      ++liz! That was exactly what I was looking for!

      Surely I noticed that feature when I read the docs of ExtUtils::MakeMaker months ago, but I completely forgot where I learnt about it; just remembered that something somewhere worked that way.

      Thanks a lot!

      Ciao!
      --bronto


      The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
      --John M. Dlugosz

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-10-25 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (146 votes), past polls