Reference: sub
Author: Ellen Siever, Stephen Spainhour & Nathan Patwardhan
Date: 1999-07-02T01:38:25Z

#

| Chapter 5 Function Reference |

## sub

    sub name [proto] {block}
    sub [proto] name

Declares and defines a subroutine. name is the name given to the subroutine; block is the code to be executed when the subroutine is called. Without block, this statement only declares a subroutine, which must be defined at some later point in your program. proto is a sequence of symbols that places constraints on the arguments that the subroutine will receive. See Section 4.7, "Subroutines" in Chapter 4.

Reference: study |  | Reference: substr