Mailing List Archive

1 2  View All
Re: use v5.36; use warnings; [ In reply to ]
On Sun, Jun 20, 2021, at 7:31 PM, Yuki Kimoto wrote:
>
> Is it possible to improve use vx behavior in the future keeping backwards compatibility of past use vx behavior?

Yes, but I believe the gain here is extremely small, and not worth the complexity it would introduce.

--
rjbs
Re: use v5.36; use warnings; [ In reply to ]
2021-6-19 4:25 Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:

>
> - but some people had already been writing "use strict; use warnings;
> use v5.10.0" and we didn't want to hurt them
>
>
I want more examples for conversation. I want to know both current behavior
and desirable behavior.

[1]
use v5.10;
use strict;
use warnings;

[2]
use strict;
use warnings;
use v5.10;

[3]
use strict;
use warnings;
use v5.36;

[4]
use v5.36;
use strict;
use warnings;
Re: use v5.36; use warnings; [ In reply to ]
Op 29-05-2021 om 04:29 schreef Darren Duncan:
> On 2021-05-28 7:12 p.m., Ricardo Signes wrote:
>> On Fri, May 28, 2021, at 9:29 PM, Darren Duncan wrote:
>>> What I would expect to happen is that the statements are applied in
>>> order.  So a
>>> "no warnings" above the "use" would have no effect, turning warnings
>>> off before
>>> they're turned on again, but having it following the "use" would
>>> turn warnings
>>> off after they're turned on. -- Darren Duncan
>>
>> Except that's not how this works with strict, so the question is
>> where we choose to be consistent.
>
> Here's an idea.  If a file contains "use 5.36" or higher, and it
> contains either "no warnings" or "no strict" above that use line, then
> a warning will be emitted that the "no" should be below the "use"
> rather than above it.  This only happens for programs with "use 5.36"
> so older programs won't get extra warnings.  The warnings only appear
> when someone makes the explicit change to add the "5.36" and then it
> will say okay you just made that change now make this change.  Also
> the use warnings behavior will be dependent on order rather than not
> like use strict. -- Darren Duncan


This seems like a good way out of this conundrum. It solves all problems.


M4
Re: use v5.36; use warnings; [ In reply to ]
On Mon, Jun 21, 2021, at 12:04 AM, Yuki Kimoto wrote:
>
> 2021-6-19 4:25 Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
>> * but some people had already been writing "use strict; use warnings; use v5.10.0" and we didn't want to hurt them
>
> I want more examples for conversation. I want to know both current behavior and desirable behavior.

I would like to establish that the standard practice with a question like this is for the poster (you, here) to provide the answers that are easy to provide.

If you're asking about what *I *think is desirable, you can't answer that, but you could easily determine the current behavior of each of those examples to include in your post.

--
rjbs
Re: use v5.36; use warnings; [ In reply to ]
2021-6-22 4:06 Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:

> On Mon, Jun 21, 2021, at 12:04 AM, Yuki Kimoto wrote:
>
>
> 2021-6-19 4:25 Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
>
>
> - but some people had already been writing "use strict; use warnings;
> use v5.10.0" and we didn't want to hurt them
>
>
> I want more examples for conversation. I want to know both current
> behavior and desirable behavior.
>
>
> I would like to establish that the standard practice with a question like
> this is for the poster (you, here) to provide the answers that are easy to
> provide.
>
> If you're asking about what *I *think is desirable, you can't answer
> that, but you could easily determine the current behavior of each of those
> examples to include in your post.
>
> --
> rjbs
>

I write about current behaviors. Is this OK?

[1]
use v5.10;
use strict;
use warnings;

Current: strict enable, warnings enable.

[2]
use strict;
use warnings;
use v5.10;

Current: strict enable, warnings enable.

[3]
use strict;
use warnings;
use v5.36;

[4]
use v5.36;
use strict;
use warnings;

1 2  View All