Encapsulate Your Main Body in a Main Subroutine June 7, 2001 Global variables can lead to problems that are difficult to debug. It is very easy, for instance, to accidentally access a global variable from a function when you think you