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

Re: Perl 7 - updates

Thread Previous | Thread Next
From:
Darren Duncan
Date:
July 5, 2020 20:06
Subject:
Re: Perl 7 - updates
Message ID:
db946b29-4485-db29-de50-13dca411b365@darrenduncan.net
On 2020-07-04 9:49 a.m., Tom Molesworth via perl5-porters wrote:
> On Sat, 4 Jul 2020 at 07:26, Sawyer X wrote:
> 
>     It is important to note that with this change, we can provide helpful
>     feedback for the user. If one were to run a newer binary with no "use
>     VERSION", we could produce an output that says:
> 
>           You need to provide the version of Perl your code targets. This is
>     done with a "use V<version number>". The following version numbers are
>     supported:
> 
> Is this for the top-level script, or would it include a separate warning for 
> every new compilation unit (module, eval, code running under 
> mod_perl/plperl/libperl etc.)? My concern is the implicit assumption here: "your 
> code". Many of the lines of code will be someone else's, thanks to CPAN.
> 
> Overall a warning like this is an improvement over the initial suggestion of 
> changing the defaults outright, so thank you for changing that decision. I think 
> it's still premature, though - why not defer this until v8? Adding this warning 
> to v7 increases the disruption and uncertainty factor. Do we really need it in v7?

Just to be clear, this isn't a "warning" in the traditional sense, rather it is 
a fatal error.

Trying to run a Perl script under version 7+ of the interpreter will just die 
immediately with the message if it doesn't start with a "use v" line.

I expect the same thing would apply down the chain; if any module is run by 
another one and the module doesn't include "use v", it would similarly die, 
because the "use v" is lexical per-file.  Perl 7 interpreter is the right time 
to do that.

The disruption avoidance is provided by that the Perl 5 interpreter doesn't do this.

-- Darren Duncan

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