perl -pi.bak -e 's/manulation/modification/' file.txt
Actually that will change the first (and supposedly unique) occurrence of 'manulation' in every line: indeed this makes sense, because the OP's request is sloppy to begin with. Anyway, he stresses that the substitution he wants must take place in a "particalur line" and mentions Tie::File, although to the effect of not wanting to use it. Thus I suspect he really wants the substitution to happen on a given line. But then... editi: given by what? If by a line number, say the tenth, then it's easy; you just have to enhance the above to:
perl -pi.bak -e '$.==10 and s/manulation/modification/' file.txt
If it's something different, then you have to tell us. |