Why are global variables poor style?
For now, we’re just telling you not to do them. Global variables become troublesome as your programs get larger. The problem with global variables is that you increase the chance that something will be changed in a way that you didn’t expect. By definition (since you didn’t expect it), this is hard to debug. If your subroutine does change a global variable, you should document this in the subroutine header comment.