Your example is quite unclear to me. What is this supposed to to?
Well, I had two choices in asking this question. Give the long version of the story describing the software I am developing and all the classes and all the things the classes are doing, or simply create a simple example showing what I did and how I didnt like how I did it. I decided on brevity.

But to answer your question the way a lawyer does things, I will tell you exactly what the sub mylol is doing but not tell you exactly what big problem I'm writing a big solution to: mylol is a subroutine that subclasses lol from a package in the XML::Quickbooks::Tolol::* name space, such as you see on line 43 here . That sub lol builds an arrayref of arrayrefs for HTML::Element's new_from_lol method. As you can see, the first thing that sub does is get a hashref via $self->data. However, the data that I receive for this one subclass is not in the right format for the parent, so I needed to modify it.

You could simply localize ->{data} and be on your merry way:
"be on your merry way" - lol. Thank you. I thought only package variables, not hashref slots, could be localized. That does exactly what I want.
I'm not sure what that contraption is supposed to achieve, but then, maybe that's because I have either never encountered the problems that Moose attempts to solve or have always taken other approaches to these problems.
Wow, Moose is a godsend to me.



The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"


In reply to Re^2: creating an altered clone of a Moose object for a limited scope by metaperl
in thread creating an altered clone of a Moose object for a limited scope by metaperl

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.