$data = init(); while(still_alive) { process($data); } continue { $data = getSample(); print $logfile "Input contained $data"; next if invalid($data); } #### STATE: until ($state->name eq 'Ending') { $state->action(); redo STATE if nothingHasChanged(); } continue { $state = $state->nextState(context); next STATE unless $blackList->contains($state); #here we want to go to the next state without processing the current one }