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

hi prasad is your solution takes in to consideration that there are many other lines , other than what i want to replace. Thanks sachinc

Replies are listed 'Best First'.
Re^3: change a line or string in file
by prasadbabu (Prior) on Jan 19, 2005 at 10:20 UTC
    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

    A reply falls below the community's threshold of quality. You may see it by logging in.