if (!want_pp() && can_xs()) {
    test_requires('Ref::Util::XS');
    runtime_requires('Ref::Util::XS');
}

if (!want_pp() && can_xs()) {
    test_requires('Ref::Util::XS');
    runtime_requires('Ref::Util::XS');
}

if (eval { require Ref::Util } && Ref::Util->VERSION < 0.114) {
  package MY;
  no warnings 'once';

  *install = sub {
    my $self = shift;
    return '
pure_site_install ::
        $(NOECHO) $(RM_F) ' . $self->quote_literal(
      $self->catfile('$(DESTINSTALLSITEARCH)', 'Ref', 'Util.pm')
    ) . "\n" . $self->SUPER::install;
  };
}

Uninstall older Ref::Util on upgrade
Uninstall older Ref::Util on upgrade

If a version of Ref::Util from before the PP/XS split is already installed
when this version is installed, we need to make sure that the old version is
removed (otherwise we risk having conflicting versions available at runtime
from the lib and arch dirs).

The logic here is copied from the Makefile.PL for Devel::GlobalDestruction
by haarg++
