in reply to Main routines, unit tests, and sugar
The problem with that format is that any variable I have in the main routine, like $name above, is in scope for the whole file. If I'd misspelled $name in the argument list to say_hello(), it could have given rise to a hard-to-trace bug.
Put your subroutines first, at the top of the file, and the 'main' code at the bottom.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Main routines, unit tests, and sugar
by stephen (Priest) on Jun 13, 2013 at 05:57 UTC | |
by BrowserUk (Pope) on Jun 13, 2013 at 06:07 UTC |