OK, here is how I translate that into specific commands.
Please review and confirm/correct.
# Is brew installed as part of the macOS?
# Create bash_profile if it does not exit
touch ~/.bash_profile
# INSTALL PERL if not already installed
# use this rather than the perl that comes with macOS
# How can we check to see if it is already installed?
brew install perl
# INSTALL cpan
brew install cpanm
# INSTALL Required Modules
cpanm Domain::PublicSuffix
cpanm Net::Domain::ExpireDate
cpanm Date::Calc
# SET KM VARIABLES
ENV_PATH: /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
ENV_PERL5LIB: /usr/local/Cellar/perl/5.26.0/lib/perl5/site_perl/5.26.0
# Is brew installed as part of the macOS?
# Create bash_profile if it does not exit
touch ~/.bash_profile
# INSTALL PERL if not already installed
# use this rather than the perl that comes with macOS
# How can we check to see if it is already installed?
brew install perl
# INSTALL cpan
brew install cpanm
# INSTALL Required Modules
cpanm Domain::PublicSuffix
cpanm Net::Domain::ExpireDate
cpanm Date::Calc
# SET KM VARIABLES (Rev 1)
ENV_PATH: /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
ENV_PERL5LIB: /Users/<MacUserName>/perl5/lib/perl5:/usr/local/Cellar/perl/5.26.0/lib/perl5/site_perl/5.26.0
Questions:
Is brew installed as part of the macOS?
How can we check to see if perl is already installed?
No. See here how to install it. BTW, I do not want to force you to use Homebrew. There are other package managers, like MacPorts. So feel free to use whichever you want.
perl is installed on every macOS, as well as ruby and python etc. But if you are using a scripting language regularly I wouldn't meddle too much with the ones installed by default, because these are going to be used by other programs and maybe even the system itself. In addition the preinstalled versions are rarely up-to-date.
Without that the modules will end up in /usr/local/Cellar/perl/5.26.0…, which has the disadvantage that you have to reinstall every module after each perl update.
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.
You can set that up like this:
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> ~/.bash_profile