
| Contents |
|||||||||||||||
| [an error occurred while processing this directive] |
7.1 Defining Subroutines
Defining a subroutine is quite easy. You use the keyword
use strict; sub HowdyEveryone { print "Hello everyone.\nWhere do you want to go with Perl today?\n"; } Now, anywhere in the code where we want to greet the user, we can simply say: and it will print that message to the user. In fact, in most cases, the&HowdyEveryone; & for invoking subroutines is optional.
|