Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Three suggestions.

First of all if you have reason to force code to be kept in sync (and keeping names/passwords in a config file is good enough reason for me) then you can partially alleviate the problem by putting in run-time sanity checks. For instance use and confess away if someone tries to connect that you don't know about, or if your config file doesn't have all of the information that you expect. While having no synchronization is best, a close second is to have rapid and detailed feedback upon breakage.

The second is about your indentation style. Yes, I know that a lot of people line up their indentation like that, but it is a maintanance hassle and comprehension is inhibited when indents go to 6 or more spaces in. My style is that if I am forced to move to another line, then I hit return and indent as I would for a block. YMMV on that, but consider how fast you indented way past 80 columns.

I don't like having the config file hardcoded into the module. What I use at work is a (sorry, proprietary) configuration module that avoids having any hardcoded file names. Rather have an access method of some sort which decides where to get the configuration from dynamically. Why? Well that makes tracking down all of the configuration files that you are using a lot easier. It makes it easier to separate development from production. (Each just picks up configurations with slight but significant distinguishing features - like what database to connect to.) And if you code the configuration logic correctly, you can have it pick up tyops in your configuration file.

In reply to Re (tilly) 1: Best practice with polymorphic constructors by tilly
in thread Best practice with polymorphic constructors by Ovid

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2017-11-23 19:03 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (337 votes). Check out past polls.