in reply to The purpose of prototypes in perl subroutines

You're mostly correct; perl's prototypes can impose a "datatype" i.e. scalar or array on subroutine arguments. However, that is a very controversial use of prototypes, since it tends to get people into all kinds of very subtle bugs.

Other sligtly less controversial uses for prototypes are to be able to create constant subroutines and subs that take bare code-blocks as an argument (like grep and map do).

If you search for prototypes on this site you'll find a lot more information and probably some heated debate :-)

Some interesting nodes:

When to use Prototypes?
Function Prototypes
Far More Than Everything You've Ever Wanted to Know about Prototypes in Perl

  • Comment on Re: The purpose of prototypes in perl subroutines