How to trim URL to root domain?

Yep. Your macro works like a charm: :smile:

Whew! What a workout! :wink:

Thanks for all your help and patience, Tom. Much appreciated.

Here's my final instructions:

### 1. Install Homebrew IF not installed ###
# To See if Homebrew is installed:
type brew

# IF NOT installed, will return:
# -bash: type: brew: not found

# TO INSTALL Brew: #
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# IF installation is successful, you will see:
# ==> Installation successful!

### 2. Create bash_profile if it does not exist ###
touch ~/.bash_profile

# this creates an EMPTY file???

### 3. INSTALL PERL if not already installed ###
# use this rather than the perl that comes with macOS
# To See All Installed Versions of perl:
type -a perl

# Returns ONLY this IF you need to install latest ver:
# perl is /usr/bin/perl

# Install to get perl 5.26+ (in addition to macOS ver)
brew install perl

# If successful, you will see something like this:
# /usr/local/Cellar/perl/5.26.0: 2,389 files, 57.3MB

#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
# Answer yes to auto-configure question.

# Then execute this:
echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> ~/.bash_profile
  
### 4. INSTALL cpanm (aka cpanminus) ###
# It is an alternate (but well established) CPAN package manager. 
# It is less difficult to handle
brew install cpanm

### 5. INSTALL Required Modules ###
# Install one at a time.
cpanm Domain::PublicSuffix
cpanm Net::Domain::ExpireDate
cpanm Date::Calc

### 6. SET KM VARIABLES (Rev 1) ###
# Do this in KM Editor App, Preferences > Variables
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

1 Like