The most basic subroutine declaration is simply the sub keyword, followed by the name of the sub, followed by the block that defines the sub: sub alert { print "We have normality."; } The simplest subroutine call is just the subroutine name followed by a comma-separated list of variables or values: $result = sum($a, $b, 42, 57); Arguments are also sometimes passed as anonymous pairs: $result = sum(first => 12, second => 21); Parentheses are optional on calls to subroutines that have been predeclared, but required for all other calls. Including the & sigil before the subroutine name in a call will not turn off signature checking. In fact, in most contexts prefixing the subroutine name with & will return a reference to the subroutine instead of calling the subroutine. |