my $re = qr/^$start.*$end$/; while () { print C $_ if m/$re/; }