in reply to how to create instances of classes ....

This sounds like basic inheritance.
package Parent; sub new { my ($class, @args) = @_; bless [ @args ], $class; } package Child; @ISA = 'Parent';
Calling Child->new will call Parent's new() method, but $class will be 'Child', not 'Parent'.

The "trick" is using the first argument to the class method as the class name, not hardcoding the class name into your code.


Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart