develooper Front page | perl.perl5.porters | Postings from July 2022

Re: perl -we '$00' dies in 5.32

Thread Previous | Thread Next
From:
Dagfinn Ilmari Mannsåker
Date:
July 22, 2022 14:43
Subject:
Re: perl -we '$00' dies in 5.32
Message ID:
87lesli4yi.fsf@wibble.ilmari.org
Dear Jim,

James E Keenan <jkeenan@pobox.com> writes:

> On 7/22/22 09:23, Konovalov, Vadim via perl5-porters wrote:
>> My scripts suddenly stopped working in newer perl because they use $00
>> variable.
>> $ perl -we '$00'
>> Numeric variables with more than one digit may not start with '0' at
>> -e line 1.
[…]
>> This works well in 5.26.0
>
> It worked "well" prior to 5.32 only if your definition of "working well"
> includes ignoring warnings.
>
> #####
> $ perlbrew use perl-5.30.0
> $ perl -we '$00'
> Useless use of a variable in void context at -e line 1.
> #####

That warning has nothing to do with the issue at hand, that applies to
_any_ variable used in void context, even lexicals.

    $ perl -we 'my $foo; $foo'
    Useless use of a variable in void context at -e line 1.

It only shows up here because Vadim gave a minimal example demonstrating
the new syntax error in 5.32. Artificially complicating the example
suppresses the warning, e.g.:

    $ perlbrew use 5.30.0
    $ perl -wE '$00 = $^V; say $00'
    v5.30.0

    $ perlbrew use 5.32.0
    $ perl -wE '$00 = $^V; say $00'
    Numeric variables with more than one digit may not start with '0'
    at -e line 1.

Can you please make an effort to actually understand the meaning of the
examples in bug reports, and the output you get when running them?

- ilmari

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