develooper Front page | perl.perl5.porters | Postings from February 2012

[perl #108378] Referring to floating $x under locale changes its string representation

From:
Father Chrysostomos via RT
Date:
February 2, 2012 22:36
Subject:
[perl #108378] Referring to floating $x under locale changes its string representation
Message ID:
rt-3.6.HEAD-14510-1328250987-1705.108378-15-0@perl.org
On Mon Jan 16 11:04:04 2012, public@khwilliamson.com wrote:
> 
> This is a bug report for perl from khw@karl.(none),
> generated with the help of perlbug 1.39 running under perl 5.15.6.
> 
> 
> -----------------------------------------------------------------
> In lib/locale.t $x is set to 1.23 and then used on the rhs of various
> expressions without changing it.  If this happens in a locale in which
> the radix character is say a comma, "$x" gets changed to 1,23, even
> though $x was never explicitly modified.  Then, when "$x" is referred
> to
> in a scope without locale, the comma is retained, potentially screwing
> things up.  Thus for example, '$e = "$x"' gives $e a comma and $e is
> considered to be non-numeric. Saying instead '$e = $x' does make $e
> numeric.

I think that is why $# was deprecated and removed.  It breaks number <->
string equivalence.

-- 

Father Chrysostomos


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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About