[pm-h] Perl on Linux Mint

Steven Lembark lembark at wrkhors.com
Mon Feb 3 19:27:21 PST 2020


Install your local system perl in /opt, as per the file system
standard. Put /opt/bin at the front of people's paths (vs. 
/usr/local which was done away with a decade+ ago with the
switch to SVr4).

At that point you have a single shared installation of perl that is 
easily upgraded (via the symlinks in /opt/perl) and won't interfere 
with the system perl in /usr/bin/. You also won't have to chase down
500 different copies of perl and all of its installed lib's in every
developer's home directory.

Minimal system install of a local perl that doesn't step on the 
system version, hack to suit your needs, caveat utilitor. 

#!/bin/bash

echo "Installing perl from: ${1:?Sorry, need a source tarball}";

base=$(basename $1 '.tar.gz' );
vers=${base#perl-};
args="-ds -e -Dprefix=/opt/perl/$vers -Doptimize='-O2 -pipe -march=native'";

cd /var/tmp;

gzip -dc < $1 | tar xvf -;

cd $base;

./Configure $args;

make -wk all test install;

# /opt/perl/bin is the current install.
# downgrade or upgrade via "rm *; ln -fs <version>/* ."

cd /opt/perl;
rm *;
ln -fs 5.30/* .;

# this only has to be done once or if anything new shows up in 
# the current install. 

[ -d /opt/bin/ ] || mkdir /opt/bin;
cd /opt/bin/;
ln -fs ../perl/bin/* .;

-- 
Steven Lembark                                        3646 Flora Place
Workhorse Computing                                St. Louis, MO 63110
lembark at wrkhors.com                                    +1 888 359 3508


More information about the Houston mailing list