sub generate_pmd_form { ... if(level($monk) < $n) { $pmd_form->add_submit("This post is about Perl"); $pmd_form->add_submit("This post is about the perlmonks website"); } ... } ... sub process_pmd_submit { if($form_submit eq "This post is about Perl") { print err_message("wrong forum; you meant SOPW") return generate_pmd_form(); } ... normal submission acceptance ... }