Function prototype: Difference between revisions
Content added Content deleted
Line 154: | Line 154: | ||
The perl scripting language allows prototypes to be checked during JIT compilation. Prototypes should be placed before subroutine definitions, declarations, or anonymous subroutines. The sigil [http://rosettacode.org/wiki/Special_characters#Perl special symbols] act as argument type placeholders. |
The perl scripting language allows prototypes to be checked during JIT compilation. Prototypes should be placed before subroutine definitions, declarations, or anonymous subroutines. The sigil [http://rosettacode.org/wiki/Special_characters#Perl special symbols] act as argument type placeholders. |
||
<lang perl>sub noargs(); # Declare a function with no arguments |
<lang perl>sub noargs(); # Declare a function with no arguments |
||
sub twoargs($$); # Declare a function with two scalar arguments. The two sigils act as argument type placeholders |
sub twoargs($$); # Declare a function with two scalar arguments. The two sigils act as argument type placeholders |
||
</lang> |
</lang> |