DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Trending

  • Agentic AI for Automated Application Security and Vulnerability Management
  • Docker Base Images Demystified: A Practical Guide
  • Next-Gen IoT Performance Depends on Advanced Power Management ICs
  • Implementing API Design First in .NET for Efficient Development, Testing, and CI/CD
  1. DZone
  2. Coding
  3. Languages
  4. Fast Perl Module Installation With CPM

Fast Perl Module Installation With CPM

Installing Perl dependencies slowing you down? In this article, check out CPM, a CPAN client built for parallelism and speed.

By 
Mark Gardner user avatar
Mark Gardner
DZone Core CORE ·
Sep. 28, 21 · Analysis
Likes (4)
Comment
Save
Tweet
Share
1.8K Views

Join the DZone community and get the full member experience.

Join For Free
Sports car.

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 their speed by breaking down dependencies into individual streams, installing modules in parallel, and synchronizing the necessary worker processes.

Shoichi's presentation from The Perl Conference 2016 provides a great summary:

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 it 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 --installdeps cpm 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.

Perl (programming language)

Published at DZone with permission of Mark Gardner, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!