Hi,

I agree with your aversion to global variables, but since I'm currently reengineering stepwise a large piece of code (which makes intensive use of global variables) I have to use global variables (in my first reengineering iteration) as well to keep the code working.

On the other hand: What speaks against a global variable keeping all information needed anywhere in the code? An alternative might be passing the data by parameters - which causes a lot of typo-overhead, since the data is needed anywhere in the code.

You were partially right with your conclusion "you're enamored with shiny objects" - first I had a singleton as global data structure. Then I wanted to have an easy access to the data members like hash access. This results in my idea of the marriage ...

But your suggestion only meets half the truth: I'm not able to populate the hash within an unique action - the contents of the hash has to grow/change during runtime ... Therefore I need a dynamic - and not a static - global data structure.

Beside all aspects that speak against my suggested solution: As I'm keen to improve my perl knowledge, I would like to have a solution to my problem with "multiple inheritance" and correct initialization ...

Hoppfrosch


In reply to Re^2: Multiple Inheritance - Howto marry tie::refhash::nestable with class::singleton by hoppfrosch
in thread Multiple Inheritance - Howto marry tie::refhash::nestable with class::singleton by hoppfrosch

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.