Skip to content

Instantly share code, notes, and snippets.

@earnhardt3rd
Created June 19, 2023 13:56
Show Gist options
  • Select an option

  • Save earnhardt3rd/bef105cc7e039bbcdb4e51a9a64326eb to your computer and use it in GitHub Desktop.

Select an option

Save earnhardt3rd/bef105cc7e039bbcdb4e51a9a64326eb to your computer and use it in GitHub Desktop.
require 'getopts.pl';
Getopts('m:d:t');
my $MODE = uc($opt_m) || "";
my $DEBUG = $opt_d || 0;
if (defined $opt_t) { my %TEST = &Ask();}
1;
sub Ask {
###########################################################################
#REMS# Ask(Question,Answer1,Answer2,Answer3,etc...)
#REMS# Return: User Selected Answer
#REMS# Examples:
#REMS# &Ask("Are you sure you want to UnCheckOut with Differences?","No","Yes");
#REMS# &Ask("Please select a Status:","UnAssigned","Pending","WIP","Complete");
print " DEBUG:_Common::Ask {\n" if $DEBUG > 10;
my $question = shift;
print " Question:$question\n" if $DEBUG > 10;
if ($question eq "") {return;}
my $ans="";
my $ret_val;
my %valid;
for (my $i=0;$i<=scalar(@_)-1 ;$i++) {
print " --$i $_[$i]\n" if $DEBUG > 10;
$valid{lc($_[$i])} = $i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment