Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re (tilly) 1: When to use Prototypes?by Masem (Monsignor) |
on Nov 09, 2001 at 19:13 UTC ( [id://124378]=note: print w/replies, xml ) | Need Help?? |
...or at least in Perl 5.
As pointed out in Apocolypse 2 (where's the danged thing on perl.com??) or Exegensis 2, perl 6 will have much better prototyping featurs, such that you can have something like: instead of
But prototyping in p5 is mearly a pain, and even if you do check the args by prototype, you still probably need a block of warn or die statements as you check arguments for validity at the start of the sub. So they mearly get in the way instead of being useful currently.
-----------------------------------------------------
In Section
Meditations
|
|