package InvoiceCalculator; sub new{ my( $class, $client ) = @_; my $InvoiceType = $client->InvoiceType; my $self = ....; return bless $self, "$class::$InvoiceType"; }