sub test_function { my $ref = shift; # this function takes one argument, a ref to an ARRAY # Note: you could do extra manual checking of function arguments. # Not necessarily recommended: shown for educational purposes. defined($ref) or die "oops: you did not pass any arguments"; @_ and die "oops: this function takes exactly one argument";