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 reply to Re: The "right" way to make your script run with old versions of perl
by MidLifeXis
in thread The "right" way to make your script run with old versions of perl
by xorl
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |