The only problem with this is that you can't sure that you aren't using a piece of the hash that isn't already used. A reasonable workaround is to prepend your fieldname in the hash with the package name. There are just two types of methods, which we'll call class and instance. A class method expects a class name as the first argument. It provides functionality for the class as a whole, not for any individual object belonging to the class.
Constructors are typically class methods.
Many class methods simply ignore their first argument, because they already know what package they're in, and don't care what package they were invoked via. An instance method expects an object reference as its first argument. There are two ways to invoke a method, one of which you're already familiar with, and the other of which will look familiar. We'll use the two methods defined above, the class method to lookup an object reference and the instance method to print out its attributes. The parentheses are required if there are any arguments.