When assigning a scalar variable to a list, the variable is assigned to the last value of the list. The value of an array in a scalar context is the length of the array. Individual arguments are usually assigned to local variables using the Perl subroutine local . A subroutine without an explicit return statement returns the value of the last expression evaluated which may be a scalar or an array. Perl allows a set of related subroutines to be grouped into a separate namespace called a package .
Packages allow the same subroutine name to refer to different subroutines in different packages.
Using packages avoids name conflicts when defining Perl subroutine libraries. A critical feature of Perl for AVStool is the eval function. The argument of eval is a string that represents a Perl expression. The string is evaluated as though it were part of a Perl program. In AVStool, the eval function is the link between user input and the Perl interpreter.