j> It also provides some encouragement for moving blocks of code into
j> subroutines instead of keeping them inline (although I do sometimes
j> wonder if the overhead associated with a subroutine outweighs the
j> benefit compared with a block of inline code that is only ever called
j> from one location).
my rule is to minimize inline code (except for very short scripts). subs
are a major way to ORGANIZE your code and logic flow. when i see long
linear scripts i want to pull out my hair (what little of it seems
left). i have a perloncall.com client (a regular here
who recently
gave me such a script to for code review. we are slowly refactoring it
into almost all subs so you can hide less important code (stuff like get
a dbi connection, get cgi params, etc.) and see the real flow. subs have
two major purposes but usually only one, code reuse, is taught. code
organization is just as important and if you are concerned about the sub
call overhead you are prematurely microoptimizing.
uri