Help for this page

Select Code to Download


  1. or download this
    $results = getInput(
       -prompt=>"Enter a number between 1 and 10: ",
    ...
       -LTE=>10,  #less than or equal to
       -GTE=>1,   #greater than or equal to
       -maxTries=>10);
    
  2. or download this
    @results = getInput(
       -prompt=>"Pick one or more of the following:\n",
    ...
       -list=>["apple", "banana", "carrot"],
       -allowMultiple,
       -maxTries=>10);
    
  3. or download this
    $results = getInput(
       -prompt=>"Enter a username: ",
    ...
       -restrictTo=>sub{/[A-Za-z0-9_@.-]+/} 
          # the idea is to be able to pass a regex to validate
       -maxTries=>10);