my @limits = (1,1000); #create an array with a lower and upper bound
        
sub inRange{ # return 1/true if arguments in range,
             #         undef if not
    my $toTest = shift; #note, no list specified for shift, so use @_
    my $lower = shift; # what is the lower linit
    my $upper = shift; # and upper limit

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

if (inRange(123,@limits)) { 
    print "It is in range";
} 
