Perl question: How do I access the arguments that have been passed to my subroutine or function?
Answer: The special array
@_ holds the values that are passed into a subroutine/function, and you use that array to access those arguments. The first argument is represented by the variable
$_, the second argument is represented by
$_, and so on.
It may also help to know that number of elements passed in to your subroutine is given by the value of