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

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

Thread Previous | Thread Next
From:
Karen Etheridge
Date:
August 26, 2019 16:16
Subject:
Re: [perl #134230] Numifying a 0x string evaluates the hex number
Message ID:
CAPJsHfCw9mT0kFkfj3yM5m_s260q9RC1Rpj6FbRQpumF5ub30A@mail.gmail.com
Excellent!
Could this fix please also be considered for backporting to 5.30-maint?

On Sun, Aug 25, 2019 at 5:29 PM Tony Cook via RT
<perlbug-followup@perl.org> wrote:
>
> On Mon, 19 Aug 2019 22:53:04 -0700, tonyc wrote:
> > On Fri, 28 Jun 2019 03:36:08 -0700, sisyphus@cpan.org wrote:
> > > 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.
> >
> > I don't think looks_like_number() needs to change - I think C<"0xff">
> > needs to return to numerically evaluating as 0, pre the attached.
>
>
> Applied as 14d26b44a1d7eee67837ec0ea8fb0368ac6fe33e.
>
> Tony
>
> ---
> 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