Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bang Executing Perl Scripts



Moin,

François Revol <revol@xxxxxxx> 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 <Klaus@xxxxxxxxx>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B



Messages sorted by: Reverse Date, Date, Thread, Author