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

Re: Behavior of bitwise ops on unencountered wide characters

Thread Previous | Thread Next
From:
Graham Knop
Date:
June 16, 2017 11:04
Subject:
Re: Behavior of bitwise ops on unencountered wide characters
Message ID:
CAM=m89E3--tRNRvFBcFA4wNq+m2d088bZRh_bmBghWex2nw4WQ@mail.gmail.com
On Thu, Jun 15, 2017 at 3:55 AM, demerphq <demerphq@gmail.com> wrote:
> On 9 June 2017 at 11:17, Graham Knop <haarg@haarg.org> wrote:
>> The result of ($var ^ "") can tell you the
>> status of the internal flags for a if value is a valid number, which
>> is needed for serialization.
>
> You mean it can tell you if something is a number that has never been
> stringified right?
>
> Can you explain this one a bit more?

$number & "" -> 0
$string & "" -> ""

The flags being checked are SVp_IOK or SVp_NOK.  A number that has
been stringified will still register as a number based on this check.

>
> Yves
>
> --
> perl -Mre=debug -e "/just|another|perl|hacker/"

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