> Deleting the Stash entry after the call is compiled doesn't help, because the reference to the typeglob is cached.

Ran a quick test on my phone:

Looks like the typeglob˛ is looked up and the reference is stored in the OP tree. See \&main::t in #4.

That's why further manipulation will produce different results if the original typeglob isn't targeted. °

(Concise is able to backengineer the original name or is doing other introspection)

~ $ perl -MO=Concise -e'sub t {}; t()' 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter v ->2 2 <;> nextstate(main 3 -e:1) v:{ ->3 5 <1> entersub vKS ->6 - <1> ex-list K ->5 3 <0> pushmark s ->4 - <1> ex-rv2cv sK/1 ->- 4 <#> gv[IV \&main::t] s ->5 -e syntax OK

For comparison, that's what's happening when the sub is unknown at compile time

gv[*t] which most likely means "look up the symbol t at runtime"...

~ $ perl -MO=Concise -e't();' 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 5 <1> entersub[t2] vKS/TARG ->6 - <1> ex-list K ->5 3 <0> pushmark s ->4 - <1> ex-rv2cv sK/1 ->- 4 <#> gv[*t] s/EARLYCV ->5 -e syntax OK ~ $

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

°) especially deleting the entry in the namespace prevents the compiler to find the old typeglob.

˛) or is it only the CODE slot? How reliable is concise here???


In reply to Re^2: Refresh a Module by LanX
in thread Refresh a Module by Timka

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.