Lecture: Subroutines
Published Wednesday, March 08, 2006 by Mathieu | E-mail this post
It's hard to make a topic like subroutines interesting.
You have, of course, sigh, the option of sending parameters to a subroutine.
many Unic protrams can act as filters
<> diamond operator. Returns as much input as there is.
If there are no comad line options then it acts like
sub name
{
#body goes here
}
You almost never need to use the & character, only when it's ambiguous. But we're encouraged to use the ampersand and brackets.
@_ is the list that has been passed into me.
Remember the value of pi? It's a good party trick anyway.
returning
Last value evaluated
Can use the return keyword
Return value can be a scalar or list
0 Responses to “Lecture: Subroutines”
Leave a Reply