Try grepping for just "PVLV". I find 10 hits in sv.h and 11 in sv.c

What I haven't found, is a clear example of allocating one and setting it up properly. I've tried to reverse engineer it based mostly upon the PerlGuts description and what I can glean from the Devel::Peek output, but so far without success.

use Devel::Peek qw[ Dump ];; Dump \substr 'fred', 1, 2;; SV = RV(0x78148) at 0x78138 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x3d39898 SV = PVLV(0xf3758) at 0x3d39898 REFCNT = 2 FLAGS = (PADMY,GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x3e5eda8 "re"\0 CUR = 2 LEN = 8 MAGIC = 0x3e75af8 MG_VIRTUAL = &PL_vtbl_substr MG_TYPE = PERL_MAGIC_substr(x) TYPE = x TARGOFF = 1 TARGLEN = 2 TARG = 0x3d39f58 SV = PV(0x3e25950) at 0x3d39f58 REFCNT = 2 FLAGS = (PADTMP,POK,READONLY,pPOK) PV = 0x3e5ece8 "fred"\0 CUR = 4 LEN = 8

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

In reply to Re^2: XS: SvPVLV examples? by BrowserUk
in thread XS: SvPVLV examples? by BrowserUk

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.