in reply to Re: Substituting tokens into configuration values
in thread Substituting tokens into configuration values
I would suggest one little change to the regexp:
This way it should be quicker since it does not force Perl to backtrack after it slurps up the whole general-scheduledb.while ($cmdline =~ s/%([^%-]+)-([^%]+)%/$config{lc $1}{lc $2}/eg)
Of course it's not entirely equivalent. If your INI contained %foo-bar-baz%, then your regexp would match it like %(foo-bar)-(baz)% and mine as %(foo)-(bar-baz)%. I don't think it matters.
Jenda
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Substituting tokens into configuration values
by dbush (Deacon) on Mar 21, 2003 at 11:17 UTC |