How to install Perl on macOS 10.13 High Sierra : <p>I recently upgraded to macOS 10.13 High Sierra and shortly after encountered a problem attempting to install a more recent version of Perl (5.26.1). The gist of the problem is that the self-tests for <code>cpan/DB_File</code> consistently failed on macOS 10.13 High Sierra (home laptop) but succeeded on macOS 10.12 Sierra (work laptop). </p>

<p>Here's the section of the installation log showing the failure:</p>

<pre><code>../cpan/Config-Perl-V/t/30_plv5240.t ............................... ok
../cpan/Config-Perl-V/t/31_plv52511.t .............................. ok
../cpan/DB_File/t/db-btree.t ....................................... ok
Use of uninitialized value $value in string eq at t/db-hash.t line 224.
Use of uninitialized value $values[0] in string eq at t/db-hash.t line 224.
Use of uninitialized value $value in lc at t/db-hash.t line 224.
Use of uninitialized value $h{""} in string eq at t/db-hash.t line 243.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value $foo[18] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[36] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[48] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[58] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[59] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[60] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[62] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[63] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[92] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[114] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[140] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[187] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[188] in join or string at t/db-hash.t line 261.
Use of uninitialized value $foo[189] in join or string at t/db-hash.t line 261.
Use of uninitialized value $h{"Fred"} in string eq at t/db-hash.t line 572.
Use of uninitialized value $v in concatenation (.) or string at t/db-hash.t line 748.
../cpan/DB_File/t/db-hash.t ........................................ 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 76/166 subtests 
</code></pre>

<p>I was able to repeat this same failure whether installing using <code>perlbrew install perl-5.26.1</code> or simply downloading <a href="http://www.cpan.org/src/5.0/perl-5.26.1.tar.gz" rel="noreferrer">the Perl tarfile</a> and installing manually. When I try to debug the test in question <code>t/db-hash.t</code>, I can see that the test hash <code>%h</code> is created and is being populated in the test file, but when I <code>print Dumper(\%h)</code> I see that the hash looks to have the right keys, but <em>all</em> of the values are <code>undef</code>, rather than the values being assigned in the test script. </p>

<p>These <code>undef</code> values are causing the test failure. Oddly, the undefined values show up when I print the whole hash or try to make an array of the hash values. If I ask for a specific hash key's value, e.g. <code>my $value = $h{key}</code>, the value prints fine.</p>

<p>Questions:</p>

<ul>
<li>How to fix this so that I can install a new Perl on macOS 10.13?</li>
<li>What broke? This used to work on macOS 10.12.</li>
</ul>
