LanX:

In the page you linked, it looks like lines 1612 and 1613 (inside subroutine maybe_my) fetch the information from the PAD if it's a typed PAD:

1607: if ($op->private & OPpLVAL_INTRO and not $self->{'avoid_local'}{ +$$op}) { 1608: # Check $padname->FLAGS for statehood, rather than $op->p +rivate, 1609: # because enteriter ops do not carry the flag. 1610: my $my = 1611: $self->keyword($padname->FLAGS & SVpad_STATE ? "state +" : "my"); 1612: if ($padname->FLAGS & SVpad_TYPED) { 1613: $my .= ' ' . $padname->SvSTASH->NAME; 1614: }

I didn't dig any further into it because it looks like the right thing. Hopefully that'll get you on the trail to the info you're looking for.

Note: I got lucky when looking for it, as I first did a ^F in the browser looking for my, but it indicated over 1000 results. However, it also added highlights, drawing my attention to the first item: OPpTARGET_MY. Changing the search to _my gave a mere 6 locations, and the third one shows where the type name gets added to the "my TYPE VAR" output for Deparse. Had it not done so, it may have taken a while to dig it up.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^5: Introspecting type informations? HvNAME(SvSTASH(SvRV(ST(0)))) by roboticus
in thread Introspecting type informations? by LanX

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.