There's no such thing as a SvUV. A ref can be in practically any type of SV (at least SvIV, SvNV, SvPV, SvPVIV, SvPVNV).

>perl -MDevel::Peek -e"my $x = {}; Dump($x);" SV = IV(0x3269b8) at 0x3269c0 REFCNT = 1 FLAGS = (PADMY,ROK) ... >perl -MDevel::Peek -e"my $x = 'abc'; $x = {}; Dump($x);" SV = PV(0x33abe0) at 0x2a69d0 REFCNT = 1 FLAGS = (PADMY,ROK) ... >perl -MDevel::Peek -e"my $x = 'abc'; $x = 123; $x = {}; Dump($x);" SV = PVIV(0x28da78) at 0x2a6a60 REFCNT = 1 FLAGS = (PADMY,ROK) ...

A reference is indicated by the ROK flag. The pointers of references are neither IV nor UV. The pointers are returned as SV* as they should. The actual pointer is located in the same location as an IV's number or UV's number, so ROK && IOK is impossible.

illguts

Update: It appears possible to have an SV that is both ROK and IOK. It would have to be hand-crafted; Perl never constructs one. No idea if it's safe to construct one.


In reply to Re: SvUV vs SvIV for pointers in SVs, typemap by ikegami
in thread SvUV vs SvIV for pointers in SVs, typemap by patcat88

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.