On Thu, Jul 9, 2009 at 5:34 PM, Alpesh Naik<naik.alp...@gmail.com> wrote:
>
> For eg: below is what I have in the config file "configfile.cfg".
>
> Key1=OldValue1
> Key2=OldValue2
>
> I want to search for "Key1" and change "OldValue1" to "NewValue1"

Read the content into memory, search the key (i.e, use a regex) and
replace the value, then write back to the original file.


>
> *(Note that, permission of config file is 600, i want to edit the file
> without changing permissions)*

You couldn't unless using a wrapper like sudo.


Jenn.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to