I avoid prototypes in my code, except for the empty prototype '()' to create "Constant Functions".
In v5.36.0, the experimental status of subroutine Signatures was removed. You may find this to be a better method to declare parameters. Do note that prototypes and signatures are not different syntaxes for the same thing: follow the link for details. This is something I do like and have been using in all of my personal code since Perl v5.36.0 was released.
Not that I'm recommending it but, just so you know, you can use both a prototype and a signature with the same subroutine. If you do this, use of the :prototype() attribute is advised to avoid ambiguity.
— Ken
In reply to Re^3: Aren't there code refs as well as function refs?
by kcott
in thread Aren't there code refs as well as function refs?
by dd-b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |