[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Checken, ob ein (Perl-)Skript schon läuft



Hallo,

Am Thu, 26 Apr 2012, David Raab schrieb:
>Nein, man sollte idealerweise "/usr/bin/env perl" nutzen und nicht
>"/usr/bin/perl". Einserseits muss nicht jedes System überall gleich die
>perl binarie ablegen. Und zum anderen trifft das zu was du unter [0]
>sagtest. So gibt es nur nachteile gegenüber "/usr/bin/env perl". Die du
>dort nicht haben wirst.

==== man perlrun ====
       -T   turns on "taint" so you can test them.
            [..]  For security reasons, this option must be seen by Perl
            quite early; usually this means it must appear early on the
            command line or in the "#!" line for systems which support that
            construct.
====

$ head -n 1 ./t.pl
#!/usr/bin/env perl -wT
$ ./t.pl
/usr/bin/env: perl -wT: No such file or directory

Es gibt nen Grund warum z.B. find2perl das hier generiert:

====
#! /usr/bin/perl -w
    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
        if 0; #$running_under_some_shell
====

Ich weiß leider nicht mehr, wo ich das her habe.

just my 2¢,
-dnh

-- 
"C++ also supports the notion of *friends*: cooperative classes
 that are permitted to see each other's private parts."
     -- Grady Booch, "Object Oriented Design with Applications"


Reply to: