From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9780 invoked by alias); 25 Jan 2011 12:35:44 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28650 Received: (qmail 24865 invoked from network); 25 Jan 2011 12:35:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.12 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Klaus Ethgen Subject: Re: Bang Executing Perl Scripts Date: Tue, 25 Jan 2011 12:42:04 +0100 Message-ID: References: <1246B8BF-933E-4143-9B06-62197CE64B94__21660.9615985819$1295907908$gmane$org@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: home.ethgen.de X-No-Archive: Yes X-No-Html: Yes User-Agent: slrn/pre1.0.0-18 (Linux) Cancel-Lock: sha1:Bg9ThWCthHIx8rORlpbi9XSPagQ= Moin, François Revol schrieb: >> Why not putting #!/usr/bin/perl as the first line of your perl scripts? > > This is not portable. Portable enough today. But if you want to support minor OSs like BeOS or windows ... > BeOS and Haiku do not have /usr for ex, so perl is elsewhere. > (and so is env, so using #!/usr/bin/env perl is just moving the problem around) ... look at »perldoc perlrun«: #!/bin/sh #! -*-perl-*- eval 'exec perl -x -wS $0 ${1+"$@"}' if 0; There is a pretty good change that /bin/sh is available on relevant systems. But also for this solution, you cannot support all exotic systems. -- Klaus -- Klaus Ethgen http://www.ethgen.ch/ pub 2048R/D1A4EDE5 2000-02-26 Klaus Ethgen Fingerprint: D7 67 71 C4 99 A6 D4 FE EA 40 30 57 3C 88 26 2B