![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Perl Prototypesby hawtin (Prior) |
on Nov 02, 2002 at 07:53 UTC ( [id://209928]=perlmeditation: print w/replies, xml ) | Need Help?? |
When creating large Perl scripts I like to restrict my freedom to make mistakes, that is after all why we always start scripts with: use strict; and run with -w. I recently found out about the function prototype stuff (I know it has been there for a long while but I still have to run some of my scripts under Perl 4, so I am a bit behind the times). So I put prototypes on all my subroutines, but they are not being checked since I like to visually flag my routines with & characters. Removing all the & characters doesn't work, sometimes the -w flag correctly points out things that are difficult for the interpreter to work out. So I end up removing most of the & characters but not all. In addition the definition of prototypes does not behave as I would have expected. For example:
Sets $cat to 4 (the number of items in the list). Yes, upon reflection that is probably the right thing to do, but it is still not what I expected. So my questions:
Thank you for your attention
Back to
Meditations
|
|