A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

How to install libxmlsec1 via Alien::LibXMLSec on Mac OSX

  1. Make sure openssl is installed
  2. Download Alien::LibXMLSec (it's not on CPAN)
  3. Unzip it & change to dir
  4. perl Makefile.PL
  5. PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1k/lib/pkgconfig make
  6. make
  7. make install
Note: To get the Makefile.PL to run (i.e. step 3½), you may also need to:
  • git clone Alien::Build from its git repo
  • do a `dzil build` on that
  • then set the PERL5LIB to point to the built instance of Alien::Build
  • ...and also make sure its deps are in PERL5LIB.

How to install DBD::Pg Perl module on Mac OSX

Make sure `pg_config` is in your path, and that's it! DBD::Pg will build normally.

How to use dbdeployer to easily deploy multiple versions of MySQL for testing

Download dbdeployer, it is awesome.

Caveat: For best results, you should have a recent version of your operating system installed.

dbdeployer cheat sheet

export PATH=/path/to/dbdeployer:$PATH

dbdeployer downloads tree --flavour mysql --OS linux

dbdeployer downloads get-unpack [filename here]

dbdeployer deploy single 8.0.22

dbdeployer sandboxes

dbdeployer use msb_8_0_22

dbdeployer sandboxes --full-info

Note: Your databases will be installed into e.g. ~/opt/mysql
And a special set of controls will be put in ~/sandboxes

Working with dbdeployer

~/sandboxes/msb_8_0_22/my sql -h 127.0.0.1 --port 8022 ...etc

~/sandboxes/msb_8_0_22/metadata socket


Compiling DBD::mysql for Perl on Mac OSX

I will tell you how:


1. install the version of mysql you want

e.g. to:

~/opt/mysql/8.0.22

Maybe use dbdeployer for this (see other post)

2. set up the environment

Note: This step is at your own risk, it's not recommended.

MYSQL_DIR="~/opt/mysql/8.0.22"

ln -s $MYSQL_DIR/lib/libmysqlclient.21.dylib /usr/local/lib/libmysqlclient.21.dylib
ln -s $MYSQL_DIR/lib/libcrypto.1.1.dylib     /usr/local/lib/libcrypto.1.1.dylib
ln -s $MYSQL_DIR/lib/libssl.1.1.dylib        /usr/local/lib/libssl.1.1.dylib

3. download the DBD::mysql tarball from CPAN, unpack it install it

perl Makefile.PL --mysql_config=$MYSQL_DIR/bin/mysql_config
make
make install

Alternatively...

Make sure mysql_config is in your path, and that's it! DBD::mysql will now build normally.