I am a fan of prototypes. I know it is not recommended in Perl Best Practices because of the danger of someone pushing argments into an array and then passing the array.. e.g.
sub prototyped( $ $ ) {
print( "Arg 1: " . $_[0] . "\n" );
print( "Arg 2: " . $_[1] . "\n" );
}
my @args = ( "first", "second" );
prototyped( @args );
returns the following error:
Not enough arguments for main::prototyped
However, as much as the prototype solution is broken for this situation, I'm still a fan of prototypes.
Having prototypes has helped track down a bug in code used in production in a company whereby someone went in and modified the code adding a new parameter to each function. And then a minor bug slipped through whereby a call to one of the functions didn't provide enough arguments.
Prototypes would have caught this in the compilation phase. In fact, by adding prototypes to all the functions we caught another instance whereby a function was being called with the wrong number of parameters..