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

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

Thread Previous | Thread Next
From:
Marco Fontani
Date:
July 22, 2022 13:28
Subject:
Re: perl -we '$00' dies in 5.32
Message ID:
7ba8b7a9-745c-2743-4ae7-4b1802b953fd@gmail.com
> 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.

You can try wrapping them in ${} and they'll work again, i.e.:

$ docker run -it --rm perl:5.36 perl -E'$00="foo";say"$00"'
Numeric variables with more than one digit may not start with '0' at -e 
line 1.

$ docker run -it --rm perl:5.36 perl -E'${00}="foo";say"${00}"'
foo

The ${00} syntax also works in previous Perls, from what I can tell.

-- 
Marco Fontani
+39-329-2180550
perl -E'say v74.65.80.72'

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