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

Re: IN SEARCH OF: The definitive treatise on the "private" OK flags (SVp*OK)

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 15, 2011 15:22
Subject:
Re: IN SEARCH OF: The definitive treatise on the "private" OK flags (SVp*OK)
Message ID:
CALJW-qGanQ-7eEFp=3zrq9BixhCC0=ugbg=FRUOoeJRziR7FBQ@mail.gmail.com
On Sat, Aug 13, 2011 at 12:20 AM, Chip Salzenberg <rev.chip@gmail.com>wrote:

> However, this is a lie.  NOK is not set on this value.


It's not a lie. the scalar is indeed a PVNV.

SV = PVNV(0x83929d8) at 0x83ae2d8
  REFCNT = 1
  FLAGS = (PADMY,pIOK)
  IV = 2
  NV = 0
  PV = 0

The scalar type simply indicates what type of data the scalar *can* hold. It
doesn't indicate what kinds of data it *does* hold.

How this has escaped causing serious malfunction I don't know
>

Why would it malfunction? Are you saying that

$_=1.1; $_=1;

should also malfunction because it returns a PVNV without NOK?

$ perl -MDevel::Peek -e'$_=1.1; $_=1; Dump($_);'
SV = PVNV(0x9a939b0) at 0x9abeec0
  REFCNT = 1
  FLAGS = (IOK,pIOK)
  IV = 1
  NV = 1.1
  PV = 0

- Eric

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