above code is appending the non-matching lines also in same file, i just want to search and replace same line.open(my $FileH,"+<$meterFile"){ while (<$FileH>) { if ($_ =~ /sdpRowId:(.*)/){ #print "$_ \t $rowId\n"; $_ =~ s/sdpRowId:(.*)/sdpRowId: <ReplaceString>/g; print $FileH $_; } } close($FileH);
In reply to How to open file in Edit mode by pawank86
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |