I think that's irrelevant here. What matters is not _how_ you populate those variables, but the fact that you only want to do it once per server instance.

In ASP and Cold Fusion there's the concept of Application vairables, which are shared between all requests and processes of the server. They were great for configuration options to your application. You'd load them once (from a real config file or a DB most likely; either way relatively slow), and then you could just use the variables in each request without much overhead.

The most common way to emulate these in perl and PHP seems to be populating the variables on each request, which has always seemed somewhat wasteful to me. (when running under mod_perl I suspect there's probably a way to have real shared variables; I've never used Perl much for web programming myself)


In reply to Re^2: mod_perl / mason - variable shared between apache2's children by Crackers2
in thread mod_perl / mason - variable shared between apache2's children 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.