Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bang Executing Perl Scripts
Le 25 janv. 2011 à 12:42, Klaus Ethgen a écrit :
> 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 ...
I wouldn't call BeOS "minor". It might have had a limited diffusion, but it did introduce to the desktop OSes many concepts people now claim that they invented, like tickless, node monitoring...
"BeOS did it 15y ago"
At least you didn't mention Haiku in the list :)
As for Windows, its audience is certainly not minor, despite not having the favors of real hackers (except as a target for study). :)
>> 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.
Indeed, this would probably work in BeOS in Haiku. But I agree it looks overkill.
François.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author