Usually the parameter context specifier is unnecessary,
except in some few situations where it can be useful.
It is nothing like what appears in subroutine declarations
in most other programming languages and exists to provide
access to syntax like core functions.
For full descriptions read
perlsub, part of the
standard documention supplied with perl.
- sub foo () { ... } - This syntax is used
for functions which will never take any parameters (think
of functions like time which will return a value but
will never recieve any input) and also for constants which
will be inlined at compile time since they never change.
- sub blah ($) { ... } - This syntax is
useful for cases like this:
@foo (sin $num, time, ord $chr, @array); If sin was
, time and ord didn't have specific declarations then they
would eat the rest of the list availible, even if they only
useds 0 or 1 items of it.
- sub blah (&$) { ... } - This type
of syntax is used by map and grep to allow simple use.