if ( $action eq 'new' ) { if (!$name) { &print_error; } else { &code_to_create_new(); } }