#!/usr/bin/perl

use warnings;
use strict;

use experimental qw(signatures);

sub inRange($toTest,$lower=1,$upper=999){ # return 1/true if arguments
    # in range, undef if not
    #If the second and third params are not passed in as arguments
    # we will set them to the assigned values of 1 and 999
    #
    #The sub now requires 1 argument and will accept 1, 2 or 3

    if ($toTest >= $lower and $toTest <= $upper) {
        return 1; #true/OK
    }
    else {return undef} #the block may be all on the line
}

if (inRange(123)) { #the sub expects 1, 2 or 3 arguments
    # the second and third are optional and are set in the 
    # subroutine to default values if not provided
    print "It is in range\n";
}
