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

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

Thread Previous | Thread Next
From:
Walt Mankowski
Date:
July 25, 2022 17:45
Subject:
Re: perl -we '$00' dies in 5.32
Message ID:
Yt7Wy5bHCwCrgrfB@mawode.com
On Mon, Jul 25, 2022 at 05:31:30PM +0000, Konovalov, Vadim via perl5-porters wrote:
> From: Philippe Bruhat (BooK) <book@cpan.org> 
> 
> > However, these variables prefixed with 0 sound very fragile and confusing to me.
> > 
> > (The following examples were run under perl 5.32.1.)
> > 
> >     $ perl -E '$0999
> > = 999; say $0999'
> >     Numeric variables with more than one digit may not start
> > with '0' at -e line 1.
> 
> 
> All your examples are about $999, which is a special variable for regexps.
> Neither $00 nor $0 has any relation to regexp, so behaviour is predictably different.

The fact that neither $00 nor $0 has any relation to regular
expressions is irrelevant, because ALL identifiers that start with
digits are reserved in Perl. $0, for instance, is the name of the
program being executed.

> Not a big deal, actually.
> 
> I accept the point that my usage of perl is often non-common, with lots of non-standard approaches, so no-one else uses $00, so dropping $00 support is ok.

It seems to me the fact that you were ever able to use $00 was a bug
in those versions of Perl which has now been fixed.

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