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

Re: Perl 7 - updates

Thread Previous | Thread Next
From:
Tomasz Konojacki
Date:
July 4, 2020 00:47
Subject:
Re: Perl 7 - updates
Message ID:
20200704024738.135C.5C4F47F8@xenu.pl
On Sat, 4 Jul 2020 12:41:30 +1200
Kent Fredric <kentfredric@gmail.com> wrote:

> 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.

It does that with '-x' switch.

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