Forgot to reply to all.
---------- Forwarded message ----------
From: "David Mertens" <dcmertens.p...@gmail.com>
Date: Oct 11, 2012 6:20 AM
Subject: Re: added check for shell in installed script
To: "Boyd Duffee" <b.duf...@keele.ac.uk>

I thought this was just standard procedure for preventing silly users from
shooting their foot off by accidentally running your script with a shell,
instead of with Perl. Does EU::MM not do this? Module::Build does a few
things like this with scripts. For example, on Windows it creates .bat
files with the script name so that users can "just run" the script on their
OS.

David
On Oct 11, 2012 2:37 AM, "Boyd Duffee" <b.duf...@keele.ac.uk> wrote:

> Hi there,
>
> I found the following line added to a script that I created with
> Module::Build 0.4 and used Module::Build 0.38 to install
>
> eval 'exec /usr/bin/perl -wT -S $0 ${1+"$@"}'
>     if 0; # not running under some shell
>
> I wasn't expecting that and I'm not sure that I want it.  It doesn't
> mention
> this behaviour in the docs.  Can someone explain why?  This is my Build.PL
> script.
>
> my $builder = Module::Build->new(
>     module_name         => 'Keele::Utilities::Database',
>     license             => 'perl',
>     dist_author         => q{Boyd Duffee <b.duffee at isc.keele.ac.uk>},
>     dist_version_from   => 'lib/Keele/Utilities/Database.pm',
>     requires    => {
>         'DBI'   => '1.52',
>         'Keele::Utilities'  => '0.03',
>         'Date::Manip'   => 0,
>     },
>     build_requires => {
>         'Test::More' => 0,
>     },
>     configure_requires => {
>         'Module::Build' => 0.38,
>     },
>     add_to_cleanup      => [ 'Keele-Utilities-Database-*' ],
>     create_makefile_pl => 'traditional',
>     script_files        => {
>         'script/get_my_network_usage.pl'    => 0,
>     }
> );
>
> if ( $builder->install_destination('script') ne '/usr/local/bin' ) {
>     my $script_install = $builder->prompt('Script location',
> '/usr/local/bin');
>     $builder->install_path('script' => $script_install);
> }
>
>
> thanks,
> --
> Boyd Duffee             Keele University    (01782) 734225
> Student Facing Systems
>  <DarthBart> Nobody "codes" in Perl. Perl programs are written by eating
>              a bag of alphabet pasta and then chasing it with ipecac.
>  <xaxa>      My alphabet spaghetti only had A-Z. Perl uses the *other*
>              half of ASCII.
>
>

Reply via email to