A conversation regarding user-perl hidden lexicals popped up in the chatterbox recently. There was a thought that if you prepend the variable name with '&' then it is effectively inaccessible from user-side perl. The rest of the conversatin wasn't relevant but that's still an interesting idea. I still don't understand internals well enough to know what happens to PADLISTs on entering/leaving a lexical scope but hey...

Or... on further consideration now that you're potentially stomping on other people's lexicals I would think that your variable key should also incorporate some disambiguation between individual instances of yourself - consider including your own address in the variable name so if the user starts two iterators then both don't write on each other. Obviously this raises other concerns about circular references - your iterators are now responsible for cleaning up every CV context you've been in on iterator destruction (looks like you should turn that into an object now).


In reply to Re: Iterating & Playing with Caller's Pads by diotalevi
in thread Iterating & Playing with Caller's Pads by shotgunefx

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.