in reply to Re^6: Modernizing the Postmodern Language?
in thread Modernizing the Postmodern Language?

How many times has a person come here asking why code they found online or pieced together themselves doesn't work when it's something that would have been resolved if they knew to use strict and warnings

And the answer is of course, "Many, many times". However, if Perl7 in its proposed guise does come to pass then your question will subsequently become:

How many times has a person come here asking why code they found online or pieced together themselves doesn't work when it's something that would have been resolved if they knew to use compat::perl5?

because there's so much old, old code out there which will break on Perl7 because of the lack of backwards compatibility. Some of it is, no doubt, truly woeful code that would be better off being binned and re-written anyway [hippo waves at formmail.pl] but much of it (and an increasing amount as time goes on) is perfectly usable code under Perl5.

So Perl7 needs to cater for newbies who find old code which suddenly fails and also to folks like salva who already have lots of old code which suddenly needs to be rewritten to be portable to both existing and new perls. A vast amount of effort will be required to educate all manner of users and I fear that the Monastery will need to put about 3 or 4 FAQs on the homepage and prominently elsewhere to prevent a deluge of similar questions.

As someone who 'knows perl', adding a one line pragma to keep your wild and crazy weekend coding lifestyle intact is hardly an onerous task.

But it's not even that, is it? The pragma will fail on Perl5 so how can you trivially change the old code to be portable to both? Suddenly it becomes a considerable maintenance task.

Perhaps the real problem with this plan is that those who have proposed it have only been working with super-clean PBP-approved code for the last 5 years and have underestimated the sheer volume of older, looser code which is in active use more generally. It would be good to think that a feasible approach could be reached which caters to all but I for one can't quite see what it would be.

Replies are listed 'Best First'.
Re^8: Modernizing the Postmodern Language?
by LanX (Saint) on Jul 03, 2020 at 14:52 UTC
    > have lots of old code which suddenly needs to be rewritten to be portable to both existing and new perls

    Hmm ... shouldn't including something like use 5.10.0 imply use compat::perl5 when run under Perl 7 or later and how would this brake old code?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Having use 5.whatever imply use compat::perl5 would be a start, at least. But it wouldn't be a 100% solution because a lot of code doesn't bother to specify a Perl version.

      IMO, the most straightforward solution seems to be to add an empty compat::perl5 module to the core Perl 5 distribution (and on CPAN), so that Perl 5 will recognize use compat::perl5 as a valid statement, but one which doesn't actually do anything.

        This was about upgrading code which runs equally well on P5 and P7.

        So manually adding a simple use 5... would solve this.

        use compat::Perl5 is IMHO thought to be an automated flag introduced by P7 at compile time when downloading modules from CPAN without P7 meta tag.

        I don't think using it explicitly is a good idea, this would only add to more confusion.

        use 5... is far easier to understand and works out of the box on all older P5 installations.

        It would be nice to see a formal RFC and a test suite covering all disputed edge cases.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

      Indeed it should but it remains to be seen if it will.

        Is there any formal RFC where we could comment or just this fuzzy mailing list?

        I was told thats how other, now more successful, Language projects manage new features.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Re^8: Modernizing the Postmodern Language?
by Your Mother (Archbishop) on Jul 04, 2020 at 01:31 UTC

    Mmmmmm… usually when people come here with questions about old code NOW they are told, paraphrasing but… That’s crap, don’t do that.