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??
On my project I maintain a small "config" file that contains all variables that have unique values based on the hostname that the script is running on. Examples are: the path to ORACLE_HOME, etc. etc.

To keep things organized, don't put anything else in this file.

Care must be taken when switching from dev to production to use the "correct" config file. One trick to help with this is to name the config files like "<hostname>.config" and have the parent code read in $hostname.config

I have a very simple parsing routine that reads each line in the config file, ignores comments lines, and sets a name value pair in a hash. I also set some needed ENV vars too.

In my code I use the values like so:

my $localvar = $CONFIG{'TEMP_DIR'};

-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday


In reply to Re: Switching Between Development and Production Environments by freddo411
in thread Switching Between Development and Production Environments by svsingh

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 imbibing at the Monastery: (2)
As of 2024-04-24 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found