A list of Perl list processing modules
Tags: perl, cpan, lists, map
Published: 2021-05-18 14:18:42

---
title: A list of Perl list processing modules
published: true
date: 2021-05-18 14:00:00 UTC
tags: Perl,CPAN,lists,map
canonical_url: https://phoenixtrap.com/2021/05/18/a-list-of-perl-list-processing-modules/?utm_source=rss&utm_medium=rss&utm_campaign=a-list-of-perl-list-processing-modules
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6og4aeajqdhkbmd6b305.jpg
series: List processing in Perl
---

[As previously written](https://phoenixtrap.com/2021/03/16/perl_map_grep/), I like list processing. Many computing problems can be broken down into transforming and filtering lists, and **Perl has got the fundamentals [covered](https://perldoc.pl/perlfunc#Functions-for-list-data)** with functions like [`map`](https://perldoc.pl/functions/map), [`grep`](https://perldoc.pl/functions/grep), and [`sort`](https://perldoc.pl/functions/sort). There is so much more you might want to do, though, and [CPAN](https://www.cpan.org/) has a plethora of list and array processing modules.

However, due to the vicissitudes of Perl module maintenance, we have a situation where it’s not clear at a glance where to turn when you’ve got a list that needs processing. So here’s another list: **the list modules of CPAN**. Click through to discover what functions they provide.

- We’ve got [**List::Util**](https://metacpan.org/pod/List::Util) which has been released as part of Perl since version 5.7.3.
- We’ve got [**List::MoreUtils**](https://metacpan.org/pod/List::MoreUtils) which has some functions which are named the same as Util but behave differently.
- We’ve got [**List::SomeUtils**](https://metacpan.org/pod/List::SomeUtils) which duplicates MoreUtils but with fewer dependencies.
- We’ve got [**List::UtilsBy**](https://metacpan.org/pod/List::UtilsBy) which MoreUtils has also cribbed some functions from.
- We’ve got [**List::AllUtils**](https://metacpan.org/pod/List::AllUtils) which attempts to consolidate Util, SomeUtils, and ListBy but has some exceptions to called modules because of the aforementioned duplication between Util and SomeUtils.
- We’ve got [**List::Util::MaybeXS**](https://metacpan.org/pod/List::Util::MaybeXS) which helps with pure Perl fallbacks in case your version of Util is too old to have a certain function.
- We’ve got [**List::MoreUtils::XS**](https://metacpan.org/pod/List::MoreUtils::XS) which provides (some?) faster versions of MoreUtils’ functions (but you still have to `use` MoreUtils).
- And lastly, we have [**Util::Any**](https://metacpan.org/pod/Util::Any) which lets you import functions from Util, MoreUtils, and just for good measure [Scalar::Util](https://metacpan.org/pod/Scalar::Util), [Hash::Util](https://metacpan.org/pod/Hash::Util), [String::Util](https://metacpan.org/pod/String::Util), [String::CamelCase](https://metacpan.org/pod/String::CamelCase), [List::Pairwise](https://metacpan.org/pod/List::Pairwise), and [Data::Dumper](https://metacpan.org/pod/Data::Dumper). But it hasn’t been updated since 2016, so it doesn’t necessarily export the functions added to those modules since then.

**Am I missing anything? Probably!** But these are the ones most associated with being upstream on the [CPAN River](http://neilb.org/tag/cpan-river/), so they (or the modules they consolidate) have more projects depending on them.