Overall I loved attending the conference, and it really invigorated my participation in the Perl community. Stay tuned as I resume regular posting!
I’m busy this week hosting my parents’ first visit to Houston, but I didn’t want to let this Tuesday go by without linking to my talk from last week’s Ephemeral Miniconf. Thanks so much to Thibault Duponchelle for organizing such a terrific event, to all the other speakers for coming together to present, and to everyone who attended for welcoming me.
After a lot of procrastination, I’ve decided my talk for this week’s ePhEmeRaL miniconf will be “Cunningham’s Law: A Year of Being Wrong on the Internet, or «prêcher le faux pour savoir le vrai.»”
One of Perl’s cardinal strengths is the depth and variety of add-on modules to extend its capabilities, collected for the past 26 years and counting on CPAN, the Comprehensive Perl Archive Network. Starting with version 5.004 in 1997, Perl has come packaged with a module (also called CPAN) and associated command-line client for downloading and installing from this service. Some developers favor alternative tools such as CPANPLUS and its cpanp command or cpanminus and its cpanm, or tools built on the latter such as Carton and Carmel.
My favorite of these over the past several years has been Shoichi Kaji’s cpm, mainly because it’s blazingly fast. As an example, the documentation cites an installation of Plack, the Perl web application toolkit, as taking three times as long using cpanm versus cpm. Both use the same Menlo core code but cpm achieves its speed by breaking down dependencies into individual streams, installing modules in parallel, and synchronizing the necessary worker processes.
Shoichi Kaji: “Why a new CPAN client ‘cpm’ is fast” (2016)
It’s very important to note that cpm is not a drop-in replacement for the cpan or cpanm command-line tools. Firstly, it uses the subcommand install, e.g., cpm install Module::Name. Also, by default, it installs modules into a subdirectory named local/ as if you specified cpanm --local-lib-contained local. You might want this if you’re setting up a Perl project with its non-core dependencies in a separate location addressed by the local::lib module; otherwise, you should use cpm install --global to install into a directory in Perl’s @INC array. I tend to do the latter when developing, declaring my project’s dependencies in a cpanfile.
Speaking of cpanfiles, like cpanm --installdepscpm will use a cpanfile to drive project dependency installation. In fact, it defaults to looking for one if you don’t specify individual modules on the command line and supports the version-controlled cpanfile.snapshot file introduced by Carton for tracking exact dependencies used by your project. This is great for repeatedly building Docker containers and cpm makes that process even faster.
Although speed is its most important feature, cpm has a couple more tricks up its sleeve like installing from a Git repository or self-hosted “DarkPAN.” Check out its included tutorial.
Speaking of Ayn Rand, there’s another event the following weekend on Saturday, March 6. Titled “How to ‘Put a Dent in the Universe,’ ” it looks like a good (and free!) one-day conference for everyone from beginners to advanced students. Be sure to register on the web site and tune in!