bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /usr/bin/perl assumed when running src/wheel-gen.pl


From: Paul Jarc
Subject: Re: /usr/bin/perl assumed when running src/wheel-gen.pl
Date: Fri, 28 May 2004 15:19:38 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

address@hidden (Bob Proulx) wrote:
> I prefer 'use strict;' instead of -w.

ITYM "use warnings;".  "use strict;" is something separate.  The
advantage of -w is the it works with older perls.

> You can use the $^W variable like this: 'BEGIN { $^W = 1; }' but
> needing it to be in a begin routine is ugly.

That looks like it would work with old perls too.  I think the
ugliness is tolerable - this is Perl, after all. :)

> The perl -x option discards lines until a #!perl is encountered and
> then processes options from that line ignoring non-option strings.

Nice.  Do you know when that option was introduced?

>   eval 'exec perl -x -S $0 ${1+"$@"}'

Since perl won't parse those first lines, I think you don't need
eval.  You can just use exec directly.  The usual reason for eval in
similar cases is that the code is parsed by both perl and sh.
eval 'exec perl "$0" ${1+"$@"}'
  if $running_under_some_shell;

>   #!/bin/sh
>   PERL=${PERL:-perl}
>   eval 'exec $PERL -x -S $0 ${1+"$@"}'
>   #! perl -w
>   use strict;

Maybe simpler:
#!/bin/sh
exec "${PERL:-perl}" -x -S "$0" ${1+"$@"}
#!perl -w
use strict;


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]