Perl: the Markov chain saw | |
PerlMonks |
Re: where do you put your subsby Juerd (Abbot) |
on Mar 08, 2002 at 08:26 UTC ( [id://150256]=note: print w/replies, xml ) | Need Help?? |
My subs are always at the top. In my opinion, a sub should be in the file before the point where it's first used. If that isn't possible, for example when two subs call eachother, I put empty declarations above them. If you have subs before everything else, you don't have to wrap it in a BEGIN block if you need simple closures. My sripts look like this:
My modules look like:
It's just a matter of taste
In Section
Seekers of Perl Wisdom
|
|