in reply to The "right" way to make your script run with old versions of perl
Perhaps something like this?
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"; } }
--MidLifeXis
|
---|
In Section
Seekers of Perl Wisdom