Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have a Perl/MySQL project called Sylbi, and it uses a configuration file, Config.pm, that contains such things as DBI connection strings, session settings, etc. I've noticed this before in other projects, but I'm noticing it acutely on this one: That I'm basically having to maintain several copies of Config.pm. One that's being actively developed and might have experimental changes in it, one that has sensitive authentication information for my online demo, and one with default, stable settings for inclusion in the distro.

So I think the problems are pretty obvious that come about with this kind of setup. (1) Redundant edits. If I add, remove, change anything significant in the dev Config.pm, I also have to make this change in the other files. (2) Memory faults. It's easy to forget to make the redundant changes, or even to copy the wrong file to the wrong place (i.e. my demo), causing failures all around. Also in this vein is the mere headache of remembering, after some time has elapsed since working on the project, where I stored the alternate Config.pm files, whether they each contain the appropriate settings, etc.

I can't imagine this is a new problem. How would/do the Monks handle this type of thing? Are there any tools out there that would provide a better, more intuitive way to manage a single file with different orientations?

Update: I should probably try and make myself a little more clear. I was thinking that it would great if within a single file (i.e. Config.pm), you could have sections defined that could then be omitted under certain build conditions. This would be especially helpful, I think, while in development. You would only have to edit a single file, and, as in the cases I outline above, some settings flagged experimental would be removed when building the distribution, or another section with some sensitive data would be included only if you were assembling the 'demo'. Are there any tools/techniques that lend themselves to this idea?

A blog among millions.

In reply to Single file oriented for different usage by arbingersys

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found