given($answer) { when ('1') {error_entry();} when ('2') {warning_entry();} default {die "Expected 1 or 2 for the answer. Got $answer\n";} }