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

[perl #84578] Bug report: error with \L, \l, \U and \u operators

Thread Next
From:
Dan Collins via RT
Date:
August 15, 2016 16:40
Subject:
[perl #84578] Bug report: error with \L, \l, \U and \u operators
Message ID:
rt-4.0.24-2454-1471279223-945.84578-15-0@perl.org
On Tue Feb 22 02:31:59 2011, abigail@abigail.be wrote:
> > print "\L\udD\n";   # Dd    It seems, first works \L, then \u. I
> > think, it's a bug!
> 
> I tend to agree. I'd expect it to be equivalent to
> 
> lc ucfirst "dD";
> 
> But there's the "left to right" statement. Whatever that means.
> 
> > print lc "\udD\n";  # dd    Yes, the result differ from previous
> > line!
> 
> That appears to be inconsistent with "\L\udD\n";
> 
> >
> > print "\L\Ua\n";    # Syntax error, oops!
> > print "\U\La\n";    # Syntax error
> > print "\L\La\n";    # Syntax error
> 
> That's just plain weird, IMO.
> 
> Abigail

This is profoundly strange, and is still in blead as described above. Precedence issues aside, I think that "\L\udD" should eq "dd", and "\L\UdD" should also eq "dd" (and in any event should be valid syntax). I thought I understood how these parsed after digging into the other precedence ticket out there, but evidently I do not. 

-- 
Respectfully,
Dan Collins

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

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