develooper Front page | perl.perl5.porters | Postings from August 2021

Re: removing the old-style package separator

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
August 15, 2021 12:19
Subject:
Re: removing the old-style package separator
Message ID:
20210815131850.338bc831@shy.leonerd.org.uk
On Sun, 15 Aug 2021 13:02:58 +0200
Leon Timmermans <fawaka@gmail.com> wrote:

> As far as I can tell, all the pain relates to quoted strings. I would
> argue we should remove them only there, that would have all the
> benefits without actually breaking anything.

Yes and no.

The trouble with doing that is it would increase the difference in
quoting rules between qq()ed strings and elsewhere.

On Libera/#perl yesterday we encountered a new one that nobody seemed
to be previously aware of:

eval: my $x = "scalar"; my @x = ("array"); [ $x[0], ${x}[0], "$x[0]", "${x}[0]" ]

      [ 'array', 'array', 'array', 'scalar[0]' ]

Notice how the braces of `${var}[0]` act differently inside qq()ed
strings as compared without.

I'm not sure I'd like making ' act in a similarly inconsistent way
between these two places.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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