You might also consider file-scoped my variables in stead of globals. This lends itself to better encapsulation, but reduces some functionality (but then again, you didn't realy want to poke your username and password from outside this module did you?)