#!/usr/bin/perl

use warnings;
use strict;

use experimental qw(signatures);

sub inRange($toTest,$lower,$upper){ # return 1/true if param in range,
        #undef if not
    #we use a "signature" to define the expected arguments and 
    # assign them.  We still have access to @_ if we want, but as 
    # seen here, we do not need it
    if ($toTest >= $lower and $toTest <= $upper) {
        return 1; #true/OK
    }
    else {return undef} #the block may be all on the line
}

my @limits = (1,999); #the range we will test for
if (inRange(123,@limits)) { #the sub expects three args, the @limits
    # gets flattened to two providing three to the subroutine
    print "It is in range\n";
}
