develooper Front page | perl.perl5.porters | Postings from June 2019

[perl #134230] Numifying a 0x string evaluates the hex number

Thread Previous | Thread Next
From:
sisyphus@cpan.org via RT
Date:
June 28, 2019 10:36
Subject:
[perl #134230] Numifying a 0x string evaluates the hex number
Message ID:
rt-4.0.24-25781-1561718168-974.134230-15-0@perl.org
On Thu, 27 Jun 2019 22:34:32 -0700, ikegami@adaelis.com wrote:
> Changing this means changing Scalar::Util::looks_like_number. Would that
> break things?

I agree that looks_like_number()also needs to be thought about.

Perl's current behaviour is to issue the "isn't numeric" warning when "0xff"+0 is evaluated.
However, I doubt that such a warning is valid now that "0xff" is numified to 255.
It was certainly a valid warning when "0xff" numified to 0 ... but I'm thinking that warning should not be emitted for the current behaviour, and nor should looks_like_number("0xff") return FALSE.

Cheers,
Rob


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

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