package My::Interface::VersionBased; sub new { if ($some_condition) { return My::Interface::VersionBased::ForCondition1->new(@_); } elsif ($some_other_condition) { require My::External::Interface; return My::External::Interface->new( @_ ); } else { die "Unable to find a proper interface"; } }