# - yesorno.pl ------------------------
# SC 20020329
# Given prompt, return 1 for yes, 0 for no.
# check_n defaults to "No"  (return 0)
# check_y defaults to "Yes" (return 1)

sub check_n {
    local($prompt) = @_ ;
    print STDOUT "$prompt \[n\] ";
    local($answer) = scalar(<STDIN>);
    $answer =~ /^y/i;
    # Evaluates and returns true if yes
}

sub check_y {
    local($prompt) = @_ ;
    print STDOUT "$prompt \[y\] ";
    local($answer) = scalar(<STDIN>);
    if($answer =~ /^n/i){return(0);}
    return 1;
}
1;
