Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
In your specific case, I would place the datafile with the application the data is provided by. I tend to like things grouped together that were delivered together. I would then have a config file for the script that points to the database file. This makes it easier to figure out what came with what. For some reason, I can never rely on someone reading the docs I write. Fancy that ;-). If you are working on a system where someone else has the chance to arbitrarily move the application, then I would suggest a global .ini file or shell vars to specify the applications location. This allows all applications to utilize the same info without having to know where to look for anything but the .ini/shell vars (and it is now not your resposibility). Now, the sysadmin can move the app around to their hearts content (been there!) and your app always knows right where to look - and if it does not, it is not your software that is broken, but their configuration. CYA big time. I hate those 2:00 am phone calls because someone did not do what they were supposed to do. Now, they get the phone calls, because the app says "configuration elements missing, call systems administrator." Wahoo!

I have a few rules of thumb as to where the datafile belongs.

I - If the datafile is used only by the module, and never by the USEing program(s), then I tend to put it in a data directory in the Module directory (never in the same directory - I think I am superstitious ;-) I find I almost never have a datafile that fits this!

II - If the datafile is used by the program, then I place the datafile in a subdirectory called data in the program directory.

III - If the datafile is to be used by multiple programs (not simultaneously) in the same application, then I place it in a data directory in the main application directory.

IV - If the datafile is to be used by multiple applications, then I use either a system directory (/usr/local/data, /home/data,/usr/data ...) or a web directory (depending on how the applications are used).

Typically I find that almost all datafiles I use do not belong with the Module, as the dat they contain is related to the application itself.

In reply to Re: Where should a module's static datafile reside? by Anonymous Monk
in thread Where should a module's static datafile reside? by blakem

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 or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2022-01-26 16:57 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (69 votes). Check out past polls.