A Perl subroutine or function
is a group of statements
that together performs a task.
Perl uses the terms
subroutine, method and function interchangeably.
definition:
sub subroutine_name {
body of the subroutine
}
invoke:
subroutine_name( list of arguments );&subroutine_name( list of arguments );
Perl before 5.0
This still works in the newest versions of Perl,
but it is not recommended
since it bypasses the subroutine prototypes.
&subroutine_name
if you don't have arguments