I have lines in file:
Desktop DELL firewall UP CPU 20core configured
Desktop HP firewall DOWN CPU 18core unconfigured
I want to first match UP
and then if next line match DOWN
replace these two lines with some string
I tried
perl -p -e 's?.*firewall.*UP.*\n.*firewall.*DOWN.*?STRG?' file
but it doesnt work