y.txt -> file to be edited x.txt -> file that needs to be copied and written in y.txt
y.txt has
c...
w...
// search for this comment and copy the entire x.txt file here
// search end comment when you need to delete lines between these comments
g...
How do I do this in Perl? Also how do I search for both the comments and delete the lines between them?
So y.txt looks like this after insertion
c...
w...
// search for this comment and copy the entire x.txt file here
Entire x.txt file here
// search end comment when you need to delete lines between these comments
g...
The file to be inserted is about 20 lines in total. I create this file as well.