|
|
| We don't bite newbies here... much | |
| PerlMonks |
Re: Is there any difference between prototype % and @ ?by Athanasius (Vicar) |
| on Feb 22, 2013 at 14:07 UTC ( #1020167=note: print w/ replies, xml ) | Need Help?? |
|
From Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen, under the heading “Problems with Regular Prototypes”: Since we’re having so much fun, let’s move on to “%”. This “prototype” means what? That we’re expecting a hash? Not at all! In fact, it is completely identical to a “prototype” of just “@”. Everything I said about “@” is true for “%”, because they are the same! You can’t get any type checking here. It doesn’t even bother to check whether you have an even number of arguments. Not official documentation, exactly, but — well, the author did co-write the Camel Book ;-) Hope that helps,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||