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

[perl #117907] On RHS of s///, ${9} works but ${10} does not

Thread Next
From:
Father Chrysostomos via RT
Date:
July 6, 2013 21:38
Subject:
[perl #117907] On RHS of s///, ${9} works but ${10} does not
Message ID:
rt-3.6.HEAD-2552-1373146708-867.117907-15-0@perl.org
On Wed May 08 06:20:01 2013, nicholas wrote:
> On Wed, May 08, 2013 at 01:10:37PM +0000, Ed Avis wrote:
> > Another interesting wrinkle to this bug is that $010 and ${010} do
> different
> > things.  As with hash lookups, there are two things you can put
> inside the
> > curlies - a literal string or an expression - and Perl has to
> magically
> > decide which one you meant.  However, since there is no builtin
> variable $010
> > I think this may not matter much.  I would suggest that variable
> names
> > which begin with $0 but are not $0 should be prohibited, so that
> >
> >     $010 = 'a';
> >
> > would be a syntax error.
> 
> Yes, particularly as they don't seem to offer anything other than
> possibilities for obfuscation:

It has long been documented that variable can start with a digit, in
which case all the characters must be digits.  I would suggest we
deprecate use of octal in ${001} (which should affect nothing), make
${123} auto-quote, just like any other simple variable name (as opposed
to expression).  And then later we can make ${001} follow the same rules.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117907

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