in reply to Re^9: Config files
in thread Config files
Thanks for the suggestion. I think other than option 1, as you have suggested, other options would complicate a lot of things...and hence I'll specify the options that allow multiple values.
If the config file contains:
[path] root = C:\test code = %root%\code1 [array] files = hello.txt,hi.txt,howdy.txt dirs = %code%, %root%, %code%
Then, for the "dirs" array, how can I change the following regular expression to find and store all values between %%..since there can be more than one (as seen in the dirs array)...
$value =~ s{%(?:\[([^\]%]+)\])?([^%]*)%}{ if ($2 eq '') { '%' } elsif ($1 eq '') { $INIhashref->{$sectionname}{$2} } else { $INIhashref->{$1}{$2} } }ge;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Config files
by Jenda (Abbot) on Dec 12, 2004 at 00:24 UTC | |
by sparkel (Acolyte) on Dec 12, 2004 at 00:39 UTC | |
by Jenda (Abbot) on Dec 12, 2004 at 01:55 UTC | |
by sparkel (Acolyte) on Dec 15, 2004 at 03:24 UTC | |
by Jenda (Abbot) on Dec 15, 2004 at 15:01 UTC | |
|