do {
...code...
} until ($m->cmp->evaluate($m)->{score} == 1);
Note that if you are using a custom checker you will need to pass that as an option to the cmp method here. Also note that the check if the score is equal to 1 may not be correct if your custom checker gives partial credit.