James Weisensee on 16 Oct 2003 11:42:13 -0400 |
Everyone, I apologize for not giving enough background into what I was trying to accomplish. I am very new at PERL and I didn't want to write a novel in an email for a basic question or over step any bounds with this mailing list. I was just trying to be polite and not clog up everyone's email. I work for a very small ISV. Some of our clients have anywhere from 1-12 different companies, all using our software on 1 machine. What we do is create a different directory for each company that our client wants and hold the data (C-Isam database) in it's corresponding directory. I've created a config file that will hold the information of which companies data is held in what directory so I don't have search our startup scripts to find where the data is being held (since this is can be very different from client to client). To answer a question that must be on everyone's mind; No my co-workers never heard of the word "Standards". Here is snippet of my config file: NUM_DB=3 # Number of databases DCS_DB1=T12 # Command to start software for company DB1_DIR=/DS03/MF02 # Directory where data is held DB1_NM= Company1 # Name of company DCS_DB2=T15 DB2_DIR=/DS09/MF15 DB2_NM=Company2 DCS_DB3=T17 DB3_DIR=/DS02/MF17 DB3_NM=Company3 Since each client will have a variable # of companies, I wanted a way to keep the same format for my config file, across clients. Hence the the #'s 1-3 or for some it would be 1-12. This is why I was using the 'for' loop to iterate through the variable names. I just wanted to print to the screen where and how many databases each client has in one command, instead of searching around for the info. This is being used internally only. If there is a better way, I'm all ears. As far as the whitespaces go in my 'printf', I guess I could've written it: printf ("%-24s %-24s %-30s\n", etc etc but considering my "standards compliant" co-workers I was afraid they would just start getting nuts with the config file and start naming things without a forthought. So I figured I would limit the size of the names and use the whitespaces to keep things aligned. HTH and thanks for the patience, James - **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|