P
pgodfrin
Greetings,
I've browsed the Camel book and perldoc.perl.org about style in a
program and I was wondering what most people think.
I'm in the habit of the following pseudo-code structure of my programs
(or are they scripts
):
0. shebang and comments
1. Use statements
2. 'global' variables or constants
3. INIT or BEGINs
4. Subroutine definitions
5. main program, using a "MAIN:" label (just so I can find it)
6. an exit; statement
7. END code
I've seen some code where the subroutines are placed after the "main"
program - this way (my way) seems logical to me, but short of starting
a war of opinion, I was wondering what others thought about the
placement of subroutines?
regards,
phil g
I've browsed the Camel book and perldoc.perl.org about style in a
program and I was wondering what most people think.
I'm in the habit of the following pseudo-code structure of my programs
(or are they scripts
0. shebang and comments
1. Use statements
2. 'global' variables or constants
3. INIT or BEGINs
4. Subroutine definitions
5. main program, using a "MAIN:" label (just so I can find it)
6. an exit; statement
7. END code
I've seen some code where the subroutines are placed after the "main"
program - this way (my way) seems logical to me, but short of starting
a war of opinion, I was wondering what others thought about the
placement of subroutines?
regards,
phil g