[Israel.pm] Best way to invoke a script in Unix

Gabor Szabo szabgab at gmail.com
Mon Oct 15 02:12:32 PDT 2007


On 10/14/07, Yossi Itzkovich <Yossi.Itzkovich at ecitele.com> wrote:
> Hi,
>
> I used to start all my scripts with:
> #! /full/path/to/perl
>
> I saw others who used  env (perl) among other ways.
>
> Is there a "best" way to do it ?  What are the cons and pros for each
> way ?

It depends on how much do you want to make it easy to use, you can
even supply the hardware to run on :-)

Sometimes I package my scripts the same way as I package CPAN modules
and let the users install in the stand way. Then, during installation you can
check if the dependencies are in place and rewrite the sh-bang to point to the
correct perl installation.

See Module::Build and ExtUtils::MakeMaker for packaging.

In other times I provide a full Perl installation with all the
dependencies which
is a big file but makes installation easier if the script depends on
many modules.

Gabor
http://www.szabgab.com/



More information about the Perl mailing list