My recommendation for current MacOS: use Homebrew to install Perl, then install
local::lib, then use Homebrew to install gfortran and other optional dependencies to get more of the optional stuff in PDL working, then use `cpanm PDL`. Ideally we'd have an up-to-date PDL packaged for MacOS, but that isn't currently the case.