I am not impressed with that book, at all.
Using global variables is a no-no.
Choose a name for your top level module, and write all your code within your own module namespace. Then use @vars (instance variables,) or @@vars (module variables.)
Often we make each of our plugins in a sub-module of our toplevel author module.