Hello Monks,

I have a perl web application (now CGI, soon mod_perl) that depends on an external search engine I am connecting to. There are three mirrors of the search engine and what I need is something like a semi automatic failover.

So I need some place where to store the IP of the instance the application should use. If I know beforehand about maintenance going on I want to change the setting by hand but I also want the application itself to change the setting after it encounters connection problems.

This last requirement makes it necessary to save it where apache has write access - but where?

the temp-dir comes to mind but that might be cleaned by other processes (like a server restart). If I use other places I need another config variable where to find the config file. Something relative to the application dir wouldn't work with mod_perl. Putting it in the lib dir and "require"-ing it from my application is good for reading but not for writing.

So I am a bit lost with this seemingly easy task. Any ideas?


In reply to Where to store config info? by Anonymous Monk

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.