in reply to Re^5: Substitute in a subparagraph
in thread Substitute in a subparagraph

You may refine this further:
use warnings; use strict; local $/ = "\n)\n"; while (<DATA>) { my $got_end = chomp; s/\s*QUALIFIED$// unless m/^.*?clk\[\d+\]/; print; print $/ if $got_end; }