|No such thing as a small change|
Re^3: I'm trying to consolidate my functions into subroutinesby RonW (Vicar)
|on May 16, 2017 at 23:26 UTC||Need Help??|
Except subroutines are supposed to be reusable.
What LanX means is that a function is a subroutine. Specifically, a subroutine that returns a value (or a list of values).
In Perl, all subroutines return a value, either explicitly or implicitly, so all Perl subroutines are also functions.
So, the following 3 definitions are equivalent:
Many people are more comfortable using return even when not needed. When not used, the result of the last executed statement is the value returned.
In some programming languages, such as C, you can define either a function or a "pure" subroutine:
Perl, however, has no such distinction.
Update: Changed order of terms in a sentence to limit scope of the adjective "pure".