Front page | perl.perl5.porters |
Postings from June 2020
Re: Announcing Perl 7
From: Dave Mitchell
June 26, 2020 13:46
Re: Announcing Perl 7
Message ID: 20200626134610.GI3267@iabyn.com
On Fri, Jun 26, 2020 at 02:49:31PM +0200, demerphq wrote:
> To achieve this change requiring new code to include "use v7" is a
This is the bit I fundamentally don't understand. Convince me of this,
and most of my objections will fizzle away.
In my world, the big first public release of 7.0.0 will come along with
lots of explanations and docs all saying that "if you are writing modern
perl, then the first thing you need to do is add 'use v7;' to the top of
your script" - in the same way that 'use strict; use warnings' has been
the mantra for the last 20 years.
People learning perl for the first time will know nothing other than to
add 'use v7'. People working for big companies with coding standards
will be told to put 'use v7' at the top of each script.
Meanwhile, people's existing code which doesn't have a 'use vx.y.z' at
the top won't gratuitously break right now.
There is nothing to stop us from, in 5 years say, making the latest
release of of perl putting out an automatic warning along the lines of
warning: this script doesn't include a 'use vx.y.z'
header, then some time later making it fatal.
Then there's nothing to stop a later release of perl from croaking
if the vx.y.z doesn't match some minimum we've decided.
There's nothing to stop us in X years time that saying the next release of
perl won't support indirect object syntax or whatever.
In short, lets break things as and when there's a good reason to do so,
rather than break things gratuitously.
As a simple example of the problems enabling stuff by default causes,
here's a little challenge. Write a short script which uses a subroutine
with a prototype. That script must run on both vanilla 5.32.0 and 7.0.0
(by vanilla I mean a perl installation with only the modules installed
that come bundled with perl itself).
Was that easy?
This email is confidential, and now that you have read it you are legally
obliged to shoot yourself. Or shoot a lawyer, if you prefer. If you have
received this email in error, place it in its original wrapping and return
for a full refund. By opening this email, you accept that Elvis lives.