in reply to Do I need a Factory Class At This Point?
or if $z is an object of the desired type rather than a class name,# Initialize a new Z object for each element of @inits my @obj_array = map {$z->new($_)} @inits;
# Initialize a new object of the same type as $z for each element of @ +inits my @obj_array = map {ref($z)->new($_)} @inits;
|
|---|