Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Substituting tokens into configuration values

by Jenda (Abbot)
on Mar 20, 2003 at 21:34 UTC ( [id://244732]=note: print w/replies, xml ) Need Help??


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:

while ($cmdline =~ s/%([^%-]+)-([^%]+)%/$config{lc $1}{lc $2}/eg)
This way it should be quicker since it does not force Perl to backtrack after it slurps up the whole general-scheduledb.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://244732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found