Use OOP. Really. There's no reason to use refs.. though that's what objects really are.
Create a Command object that has all the base things for a "Command" and inheret off of that other commands, implementing the same method over-and-over. As for creating which command to do, put the object names in a hash and "new" the one you need.