Wow, where to start?

Do you want to have a central place (SPOT - Single Point of Truth) for certain variables seen by all your CGI scripts? Try putting things in a MySiteConf.pm module and having all scripts use MySiteConf.

In some cases, having environment variables (in the implicit %ENV hash) set appropriately can suffice. This is the case if you have the same script in various locations where it should behave differently based upon some changing circumstance. Look into checking %ENV in your perl and using SetEnv and SetEnvIf in your Apache setup.

It generally gets more complicated from there, with AppConfig and all the rest. Choose the simplest thing that fits your reasonably-anticipated needs (and is within your current level of comprehension).


In reply to Re: How to declare global variable in CGI file? by rlucas
in thread How to declare global variable in CGI file? by gube

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.