Greetings,

I sought an answer in the archives, but did not find anything quite right. Could mean my searching stinks. :)

I'm working through a web/backend code set that has been dormant for a few years, mainly migrating from mod_perl 1 to 2, but also looking at some other cleanup.

The code has a global configuration flat file containing config data which changes rarely, but must be changeable without code changes. The configuration is shared amongst a number of CGI scripts as well as back-end daemon processes.

I'm interested in instantiating a data structure in system memory to avoid performance hits reading disk in the CGI. The data structure would need to outlast any given session, which eliminates a number of solutions.

The existing implementation uses IPC::ShareLite and a shared memory segment to accomplish persisting the data.

Is there a simpler or more elegant solution?

Thanks...


In reply to Caching File-based Config across many sessions by Whiz Kid

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.