The answer to the first question is that this is why Perl allows symbolic references. There are other alternatives, but they work out to be worse in this case.

The answer to the second question is that your module should have a function called import. That will be called as a method when you use the module, and you can use that to let the calling module explain what it wants to ask for, elminating your synchronization problem.

The random tidbit that I think will be most likely to help is that you should have a search path that is readily configurable, and if at all possible you should set things up so that you can selectively override information in the path, and so that in development you pick up information differently from what you do in production.

This will make testing, developing, and deploying your system much simpler and more flexible.


In reply to Re (tilly) 1: Another config file module (any alternative to symbolic refs?) by tilly
in thread Another config file module (any alternative to symbolic refs?) by impossiblerobot

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.