Is there a perl one-liner that could replace some text between 2 strings (inclusive)? For example in the text below I need to replace everything between 'rrpv_bits = 2' and 'options.cacheline_size' with 'num_sets = 512' everywhere in the text where these 2 tag strings are found. So the original text would look like the desired one.
Original:
repl = ReplacementPolicy(rrpv_bits = 2,
ins = 2,
num_sets = l2_cache.size.getValue() /
options.l2_assoc / options.cacheline_size,
assoc = options.l2_assoc)
Desired:
repl = ReplacementPolicy(num_sets = 512,
assoc = options.l2_assoc)
If a perl one-liner can't do that then is there anything else (Linux, one-liner) that can?
Thank you