Linguistics 408/508 |
Fall 2003 |
Hammond |
sub subroutine-name { list of statements }
shift()
command (example
→ example).shift()
is given without an argument in a subroutine,
it automatically takes the special array variable @_
as an
argument. That special variable is roughly analogous to @ARGV
,
but at the level of a subroutine: all the arguments given to a subroutine are
elements in that arrray. They can be called directly, rather than by using
shift()
(example).