open inFILE, "svs.conf" or die $!; @lines = <inFILE>; close inFILE; open outFILE, ">svs.conf" or die $!; for $i (0 .. $#lines) { ($param, $value) = split(/\=/, $lines[$i]); if ($param eq 'be_address') { $value = $new_value; print outFILE $param." = ".$value; } else { print outFILE $lines[$i]; } } close outFILE;
In reply to Re: how to search and replace some text in a .conf file
by punch_card_don
in thread how to search and replace some text in a .conf file
by koti688
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |