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 }