my $obj = 'Parent'->new; $obj->populate(@data); for my $child_class (@possible_child_classes) { if (my $new = $child_class->new_from_parent($obj)) { $obj = $new; last } } # Don't forget to handle the case that $obj hasn't changed.