Perl: Defining a subroutine
Defining a subroutine
# This subroutine will print a header for a page of text
print "December Sales Report\n";
The reserved word sub, followed by a name for the subroutine, is used to define a subroutine.
The definition is followed by a block