Keep It Simple, Stupid | |
PerlMonks |
Re^2: The best way to replace several fragments of the file starting with the one pattern(marker) and ending with another pattern/marker.by likbez (Sexton) |
on Nov 01, 2020 at 16:15 UTC ( [id://11123333]=note: print w/replies, xml ) | Need Help?? |
This looks like a solution based on ingenious emulation of Perl range operator with the advantage that it can accommodate multiple fragments. Like in Perl range operator there is a variable this is true within the range and false outside. Thank you ! Here is a slightly modified variant that I used for testing: That produces: [0] # perl test_range2 aaa aaa AAAAAA f11 f12 f13 BBBBBB 111 222 333 CCCCCC f21 f22 DDDDDD 777 888 999
In Section
Seekers of Perl Wisdom
|
|