The function is just like sub. But function returns a value. A function can accept single or multiple parameters.
Defining a Function
It's really easy to define the functions.
Defining a Function #2
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0