This late in the thread, no one will probably see this, but...
I've seen several places here that have confused using prototypes with predeclaring subroutines. As I note in (tye)Re: A question of style, predeclaring your subroutines allows you to catch typos in subroutine names at compile time but only if you don't use parens when you call your subroutines. This can be a big win in some cases.
Prototypes can be used to catch other types of mistakes at compile time but the consesus is that they aren't very good at that and come with significant other problems that make their use for that purpose rarely (if ever) desirable. It is easier to make a case for using prototypes to create constant subroutines or to allow the use of bare code blocks in things that you want to have an interface similar to grep and map.
You can also use prototypes to cause arguments to be passed by reference rather than by "alias" (which looks like "passing by value" unless you modify elements of @_ directly) but many consider this a bad idea, me among them.
- tye (but my friends call me "Tye")In reply to (tye)Re: Declaring Subroutines
by tye
in thread Declaring Subroutines
by the_0ne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |