perlquestion
nvivek
Hi monks,
I want to replace a particular content in my file with some pattern. I planned to use sed with -i option to replace the pattern and make the changes effect in a original file.
My sample file content ( test.txt ) :
1
2
3
4
My script is as follows:
<code>
use strict;
use warnings;
system("sed -ie 's/\(.*\)/Number => \1/' test.txt");
</code>
When I executed the script, numerals aren't changed to Number => 1. It remains same.
Note: When I executed the sed command in shell prompt, it replaced the content of file properly as Number => 1 properly.