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

sub factory { my $class_name = shift; my @args = @_; return $class_name->new( @args ); } my $foo = factory( 'Class1', $arg1 ); my $bar = factory( 'Class2', $arg2 );
Though, frankly, since you can use a variable name as I am doing in the factory() function, you can just avoid it altogether.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?