develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Perl 7 - updates

Thread Previous | Thread Next
From:
Kent Fredric
Date:
July 4, 2020 00:41
Subject:
Re: Perl 7 - updates
Message ID:
CAATnKFB3F+kbqsF-m2ViV014eVFQp1OJj=UJ9SfnJOdZ52GdmA@mail.gmail.com
On Sat, 4 Jul 2020 at 12:35, Todd Rinaldo <toddr@cpanel.net> wrote:

>
> #!/bin/sh
> eval 'if [ -x /usr/local/cpanel/3rdparty/bin/perl ]; then exec /usr/local/cpanel/3rdparty/bin/perl -x -- $0 ${1+"$@"}; else exec /usr/bin/perl -x $0 ${1+"$@"}; fi;'
>   if 0;
>
> #!/usr/bin/perl
>
>
> As far as I understand, the Perl parser doesn't start parsing the code until it sees #!/usr/bin/perl in which case you just put use v7 after that line.

I was more under the impression it worked on bash, because bash
doesn't support a postfix "if" on a different line (bash doesn't
require semicolons like perl).

And the "if 0" made perl not execute it at all ( compile-time
constant-folded out ).

Perl parser not starting until it sees a second shebang is ... a new idea to me.

-- 
Kent

KENTNL - https://metacpan.org/author/KENTNL

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About