Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Update config file parameters

by u65 (Chaplain)
on Jan 05, 2016 at 11:59 UTC ( [id://1151945]=note: print w/replies, xml ) Need Help??


in reply to Update config file parameters

Welcome to the monastery!

First of all, you should look at perlbrew which allows you to easily use whatever version of Perl 5 you want.

Second, I would simply read the file line by line, split on the equal sign, change the value for that key as desired, and rewrite the pair to the file. You could either copy the original file to a temp file for the reads, or write to a temp file and rename it to the original name after closing it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found