lkml.org 
[lkml]   [1999]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [OFFTOPIC] #!perl - alternative path to script interpreters
David Luyer <luyer@ucs.uwa.edu.au> writes:
>Ahhh. Hence the other bit I remembered but couldn't find. There is
>some trick to put the word perl on the first line in a way it will be
>ignored. I couldn't remember what it was or why so I left it out and just
>changed /usr/bin/perl to /bin/sh (the script I quoted from was #!/usr/bin/perl
>originally) :-(

I posted it already:

: # -*-Perl-*-
eval 'exec perl -w -S $0 ${1+"$@"}'
if 0;

And this also works:
#!/usr/bin/env perl

if you want that -w thing you can add a second line if you're using perl5:
BEGIN { $^W = 1; }

- Tor

(I think the point must be that it should be portable, a linux-only solution
just don't cut it. The above tricks work fine, so why don't we just forget
about clever new Linux-only hacks? I'm not going to post more on this issue
anyway.)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.035 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site