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

Re: Bang Executing Perl Scripts



Perhaps a better solution is to leave the shebang (#!/usr/bin/perl) out of your Perl scripts; ensure that perl appears in your path and run your scripts via:

% perl myscript.pl

Be sure to add execute privs to each Perl script.

Further, you could create a zsh function to prepend each Perl script with "perl " so that you only need type:

% myscript.pl

CZ

On 1/24/11 2:14 PM, François Revol wrote:
Le 24 janv. 2011 à 22:11, Guillaume Brunerie a écrit :

2011/1/24 zzapper<david@xxxxxxxxxx>

Hi
Until now I've been writing zsh wrappers for my perl scripts:-

I've got
alias -s pl=perl
So I can execute a script just by typing its name

/usr/local/bin/info.pl


Hi,
Why not putting #!/usr/bin/perl as the first line of your perl scripts?
This is not portable.
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)

François.




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