Calling a Subroutine
-
Use &subname;
&printFooter;
-
This assumes no values are passed, but you can pass values.
-
Put those parameters in parenthesis following the subroutine name.
&printFooter("Brandan Jones");
-
Once in the subroutine, you can access each parameter with the special
underscore array. Just like any other array, but its name
is _
sub printFooter {
# print the author line
print "<br>Authored by: $_[0]\n";
print "<br>jonesbl@one.net\n";
print "<br><a href =
\"http://oz.uc.edu/~jonesbr\">http://oz.uc.edu/~jonesbr</a>";
}
Other Subroutine Functions
Home