dbush has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I appear to be suffering from brain fade today and so I'm having a bit of difficulty starting what I feel should be a simple problem. I wonder if anyone with a working brain can help?
Background: I am trying to write a Win32 service using PerlSvc from ActiveState to achieve something like this SOAP in an NT Service but as I can't predict what I will be running with it later, I wish to have the service driven by a configuration file.
Problem: I wish to enhance my configuration file with "tokens" that refer to other sections of the ini file.
This service has only the following purposes in life:
The ini looks like this:
[GENERAL] scheduledb=e:\users\dbush\schedule.db [SERVICE] debug=1 interval=5 start1=browser.exe;browser;NORMAL_PRIORITY_CLASS start2=schedule.exe;schedule "localhost:%general-scheduledb%";NORMAL_P +RIORITY_CLASS
The format of the start lines is appname;cmdline;priority.
I have the basics of this, reading the .ini, starting the processes, monitoring then and then shutting them, working well and am happy about this. The problem comes that I wish to extend the command line section to include "tokens" e.g. %general-schedule% that can be parsed to include other configuration items e.g. e:\users\dbush\schedule.db.
After briefly contemplating using one of the templating modules (node Best templating system? and various others) I'm wondering if this is a bit of a sledgehammer approach? Would a better approach be to extract the tokens, retrieve the values and then substitute them back in? I had a Super Search but with little success.
Any help appreciated.
Regards,
Dom.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substituting tokens into configuration values
by dakkar (Hermit) on Mar 20, 2003 at 13:36 UTC | |
|
Re: Substituting tokens into configuration values
by zby (Vicar) on Mar 20, 2003 at 13:34 UTC | |
by crouchingpenguin (Priest) on Mar 20, 2003 at 14:33 UTC | |
|
Re: Substituting tokens into configuration values
by Jenda (Abbot) on Mar 20, 2003 at 14:06 UTC | |
|
Re: Substituting tokens into configuration values
by hiseldl (Priest) on Mar 20, 2003 at 14:32 UTC | |
|
Re: Substituting tokens into configuration values
by robartes (Priest) on Mar 20, 2003 at 14:03 UTC | |
|
Re: Substituting tokens into configuration values
by dbush (Deacon) on Mar 20, 2003 at 17:42 UTC | |
by Jenda (Abbot) on Mar 20, 2003 at 21:34 UTC | |
by dbush (Deacon) on Mar 21, 2003 at 11:17 UTC |