develooper Front page | perl.perl5.porters | Postings from April 2004

RE: [perl #28538] Math::BigInt doesn't grok "0 but true"

Thread Previous | Thread Next
From:
Orton, Yves
Date:
April 15, 2004 08:41
Subject:
RE: [perl #28538] Math::BigInt doesn't grok "0 but true"
Message ID:
71B318898201D311845C0008C75DAD1C0A44CD07@defra1ex2
> Orton, Yves wrote:
> 
> > Doesnt that make virtually every string a dualvar?
> 
> Not unless the string has been used in a numeric context before:
> 
> > $ perl -MDevel::Peek -e '$pv = "Test"; Dump $pv; $dv = 42; 
> $dv = "HHGTTG"; Dump $dv;'
> > SV = PV(0x804d5d8) at 0x806572c
> >   REFCNT = 1
> >   FLAGS = (POK,pPOK)
> >   PV = 0x805f240 "Test"\0
> >   CUR = 4
> >   LEN = 5
> > SV = PVIV(0x804d9e8) at 0x80657a4
> >   REFCNT = 1
> >   FLAGS = (POK,pPOK)
> >   IV = 42
> >   PV = 0x805ede0 "HHGTTG"\0
> >   CUR = 6
> >   LEN = 7
> > 

I meant WRT Zefram's definition:

  0+$val ne $val

Which means that 

  0+"HHGTTG" ne "HHGTTG"

thus pretty much any string that matches \D (insert suitable handwaving
here) would be a dualvar based on his criteria.

Basically I was making this point as an addendum to Hugo saying that the
rules were more complicated than that.

Yves




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