Give a number between $lower and $higher. # We do not want a vector if ($submission=~/\,/) { return 'EXTRA_ANSWER'; } # No units needed if ($submission=~/^\d+\s+\w+$/) { return 'UNIT_NOTNEEDED'; } # Need a numerical answer here if ($submission!~/^[\d\.]+$/) { return 'WANTED_NUMERIC'; } # is it correct? if (($submission>=$lower) && ($submission<=$higher)) { return 'EXACT_ANS'; } return 'INCORRECT'; What do you get if you add $add to your number?