In another Stack Overflow question Leon Timmermans asserted:
I would advice you not to use prototypes. They have their uses, but not for most cas
Some people, looking at a Perl subroutine prototype, thinks it means something that it doesn't:
sub some_sub ($$) { ... }
To Perl, that means that the parser expects two arguments. It's Perl's way of letting you create subroutines that behave like built-ins, all of which know what to expect from the succeeding code. You can read about prototypes in perlsub
Without reading the documentation, people guess that the prototypes refer to run time argument checking or something similar that they've seen in other languages. As with most things people guess about Perl, they turn out to be wrong.
However, starting with Perl v5.20, Perl has a feature, experimental as I write this, that gives something more like what users expect and what. Perl's subroutine signatures does run time argument counting, variable assigning, and default setting:
use v5.20;
use feature qw(signatures);
no warnings qw(experimental::signatures);
animals( 'Buster', 'Nikki', 'Godzilla' );
sub animals ($cat, $dog, $lizard = 'Default reptile') {
say "The cat is $cat";
say "The dog is $dog";
say "The lizard is $lizard";
}
This is the feature you probably want if you're considering prototypes.