1. The reason I came up with this was actually because I was looking for a solution to a specific code problem that I have. I have a class that is part of an inheritance tree of classes (in the middle) that needs to have an instance of that class as a shared variable (declared using "our"). It also needs to have access to variables declared in other classes in the tree. Because of the way the inheritance is working out, I'm having difficulty finding a way to handle this without delayed initialization. And, instead of coming up with a class-specific solution, I was trying to come up with a generic solution.
  2. I think I already answered this in #1, above.
  3. It was extracted from the code I had been using to play around with the concepts. I've modified the example usage and it should work now. (I added the "use AutoVivify;" line and corrected the case on the line where a new instance is being created.)

In reply to Re^2: Automatic vivification of an object by bounsy
in thread Automatic vivification of an object by bounsy

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.