develooper Front page | perl.perl5.porters | Postings from April 2021

Re: on changing perl's behavior

Thread Previous | Thread Next
From:
Christian Walde
Date:
April 9, 2021 10:09
Subject:
Re: on changing perl's behavior
Message ID:
op.01kuhpuzydyjqt@xenbox.cihq
On Fri, 09 Apr 2021 11:51:33 +0200, Ovid <curtis_ovid_poe@yahoo.com> wrote:

>    On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde <walde.christian@gmail.com> wrote:
>
>> There's a way to make everyone happy.
>>
>> Define `use 7;` and up as: "doesn't provide format-related things".
>>
>> Define missing `use $v;` or one with $v < 7 as: "provides format-related things as they were pre-7".
>>
>> That way we don't step on any toes of format users, and Leonerd can create new syntax using format-danglies in v7+.
>
> I am not sure I understand. Are you suggesting that if you want the benefit of v7 and you want formats, you're out of luck? Or are you suggesting you have to learn more boilerplate by explicitly not using "v7" but writing the boilerplate to get the benefits of v7+formats? That isn't better than what we have, so I think I've misunderstood you.

As long as Perl dialects $v < 7 are still implemented in the interpreter you can do:

     use 7;

     sub do_format {
         use 5;
         format ...;
         write;
     }

or

     sub do_format {
         format ...;
         write;
     }

     use 7;

     do_format();

Only once it is decided that dialects $v < 7 be deprecated would those stop to work.

-- 
With regards,
Christian Walde

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