List::Pairwise provides functions to map and grep lists two elements at a time, setting $a and $b to each pair instead of setting $_ to each element. As of version 1.01, List::Pairwise now tries to use the newly implemented XS functions pairmap, pairgrep, pairfirst and pairs from List::Util 1.31 and up, resulting in a major speedup. New code should now preferably use List::Util functions directly, with the added benefit of relying on a Perl core module.