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

Re: Announcing Perl 7

Thread Previous | Thread Next
From:
demerphq
Date:
June 26, 2020 15:50
Subject:
Re: Announcing Perl 7
Message ID:
CANgJU+UAU2iR24qLRMP_8p-ks0GM8U7hKAOx4299oTo74oNgww@mail.gmail.com
On Fri, 26 Jun 2020 at 17:29, Dave Mitchell <davem@iabyn.com> wrote:
>
> On Fri, Jun 26, 2020 at 05:10:57PM +0200, demerphq wrote:
> > My understanding is any existing code which has "use strict;" will be
> > fine as "use strict" will be the same "use perl5-semantics" or
> > whatever the syntaxt will be. Thus relatively little will break.
>
> This seems to be an important and fundamental disagreement or
> misunderstanding between us, and I think it needs resolving before
> anything else gets discussed.

Ok, so just to be clear, my understanding that "use strict" and "no
strict" will be equivalent to "use perl-5-semantics; use strict;" and
"use perl-5-semantics; no strict;".

Whatever the semantics are. Since most cases people tend to do this:

package Whatever;
use strict;
use warnings;

assuming i am right this is seems to cover making old code continue to
work as though it had been modified to read:

package Whatever;
use perl-5-semantics;
use strict;
use warnings;

> My understanding was that, by default, perl7 will enable many of the
> optional features available via 'use feature X' and/or 'use v5.32.0',
> plus possibly some other stuff.

Yes, unless you request perl-5 semantics by saying "use strict;" or
"use perl-5-semantics;" (however it is spelled in practice)

> I think that this will break a *lot* of existing code and CPAN modules.
> Which is at the heart of my objection.

If I am right about strict do you agree that the scope of breakage
will be much smaller than if I am wrong?

>
> For example, disabling indirect object syntax by default will break
> all code containing
>
>     my $foo = new Foo(...);
>
> which is still a commonly-used idiom.

I don't have that impression. We have none at work for instance.  But
ok. But i think most of it runs inside of `use strict;`

> Enabling signatures by default will make it nearly impossible to portably
> write code which uses subroutine prototypes. (Seriously, try the challenge
> I set in my previous email).

Ill take another look, but again, since I can just say:

  use perl-5-semantics;

then surely it can't be impossible?

> Enabling 'use utf8' or 'feature_unicode' by default will silently change
> the semantics of code.

Again, if this only applies to code not running under use strict I
dont think it will be a big deal.

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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