in reply to Installing a module that is perl-version specific
You could have a front end (interface) that loads the appropriate back end (work horse) based on $].
BEGIN { my $backend; if ($] >= 5.010) { $backend = 'Data::Manip::Perl5010'; } elsif ($] >= 5.008) { $backend = 'Data::Manip::Perl5008'; } elsif ($] >= 5.006) { $backend = 'Data::Manip::Perl5006'; } else { die("Perl $] isn't supported\n"); } eval "require $backend" or die $@; our @ISA = $backend; }
[ Oops, Date::Manip is a procedural module, so you'll have to use AUTOLOAD or use package Date::Manip; in each of the helper modules instead of using @ISA. ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Installing a module that is perl-version specific
by chuckbutler (Monsignor) on Apr 01, 2010 at 01:23 UTC |