anchor.diff:  { stdenv
   , fetchTritonPatch
   , fetchurl
  -
  -, enableThreading ? true
   }:
   
   let
  
positive.code:   # Miniperl needs -lm. perl needs -lrt.
    configureFlags = [
      "-de"
      "-Dcc=cc"
      "-Uinstallusrbinperl"
      "-Dinstallstyle=lib/perl5"
      "-Duseshrplib"
      "-Dlocincpth=${libc}/include"
      "-Dloclibpth=${libc}/lib"
    ] ++ optional enableThreading "-Dusethreads";
  
    configureScript = "${stdenv.shell} ./Configure";
  
    postPatch = ''
      pwd="$(type -P pwd)"
      substituteInPlace dist/PathTools/Cwd.pm \
        --replace "pwd_cmd = 'pwd'" "pwd_cmd = '$pwd'"
    '';
  
    preConfigure = ''
      configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
    '' + optionalString (!enableThreading)
    /* We need to do this because the bootstrap doesn't have a
       static libpthread */ ''
      sed -i 's,\(libswanted.*\)pthread,\1,g' Configure
    '';
  
    preBuild = optionalString (!(stdenv ? cc && stdenv.cc.nativeTools))
      /* Make Cwd work on NixOS (where we don't have a /bin/pwd). */ ''
        substituteInPlace dist/PathTools/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
      '';
  
    # Inspired by nuke-references, which I can't depend on because it uses perl. Perhaps it should just use sed :)
    postInstall = ''
      self=$(echo $out | sed -n "s|^$NIX_STORE/\\([a-z0-9]\{32\}\\)-.*|\1|p")
  
      sed -i "/$self/b; s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" "$out"/lib/perl5/*/*/Config.pm
      sed -i "/$self/b; s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" "$out"/lib/perl5/*/*/Config_heavy.pl
    '';
  
    passthru = {
      libPrefix = "lib/perl5/site_perl";
      srcVerification = fetchurl rec {
        failEarly = true;
        urls = tarballUrls "5.28.0";
        outputHash = "059b3cb69970d8c8c5964caced0335b4af34ac990c8e61f7e3f90cd1c2d11e49";
        inherit (src) outputHashAlgo;
        sha256Urls = map (n: "${n}.sha256.txt") urls;
        sha1Urls = map (n: "${n}.sha1.txt") urls;
        md5Urls = map (n: "${n}.md5.txt") urls;
      };
    };
  
    outputs = [ "out" "man" ];
  
    preCheck =
    /* Try and setup a local hosts file */ ''
      if [ -f "${libc}/lib/libnss_files.so" ] ; then
        mkdir $TMPDIR/fakelib
        cp "${libc}/lib/libnss_files.so" $TMPDIR/fakelib
        sed -i 's,/etc/hosts,/dev/fd/3,g' $TMPDIR/fakelib/libnss_files.so
        export LD_LIBRARY_PATH=$TMPDIR/fakelib
      fi
    '';
  
    postCheck = ''
      unset LD_LIBRARY_PATH
    '';
  
    addPrefix = false;
  
    # This is broken with make 4.2 and perl 5.22.1
    installParallel = false;
  
    meta = with stdenv.lib; {
      description = "The Perl 5 programmming language";
  
negative.code:   src = fetchurl {
      urls = tarballUrls version;
      hashOutput = false;
      sha256 = "fea7162d4cca940a387f0587b93f6737d884bf74d8a9d7cfd978bc12cd0b202d";
    };
  
    patches = [
      # Do not look in /usr etc. for dependencies.
  