in reply to Re^2: change a line or string in file
in thread change a line or string in file

sachin chat,

$/ is a input record separator, when you read a content in the file, it will undef the newline characters("\n") in the file if we use undef $/;. (default value of input record separator is "\n")

$instr will take all the contents in the file (not first line alone).

is your solution takes in to consideration that there are many other lines

yes, if there is also only one line, you will get the correct output.

Prasad

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.