When I need to share global things, most of all I want it to be maintainable. I put all of the global-things into one module with "getters" and "setters" to access them, and those subs are suspicious, checking for errors such as references to non-existent variables or attempts to set a value to the wrong data-type. I want all of the logic that actually sets or returns these values to occur in only one module – this one – and if something is wrong, anywhere, I want to see an exception being thrown such that I can get a traceback that leads me directly to the source-line where the otherwise-unfindable problem is. There are good CPAN modules to help ... the most obvious one being Moose or any of its lighter-weight cousins.

I also don't want things to be loaded dynamically, as in do, unless there is a compelling need for it. I literally want to know what the executing source-code consists of at all times, so that I do not have to be concerned whether a particular module had been "done yet" or not.

In reply to Re: including variables by Anonymous Monk
in thread including variables by LloydRice

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.