my $data = read_port(); while( 0 == match_data($data) ) { do_if_no_match(); $data = read_port(); } process_match($data); do_if_no_match(); # End.