As others point out, the flip-flop operator can work, except that it'll return true on your finish condition, which you seem to want to exclude (update: also, why the useless "$State = $State" statement?). Also, I'd not use the ternary "?:" operator in this case, since its purpose of it is to return a value, which you don't use. So here's my go at it:
for (@input) {
my $status = /$start/.../$finish/;
if ( $status and $status !~ /E/ ) {
do_this();
} else {
do_that();
}
}