http://qs321.pair.com?node_id=11144897


in reply to perl 5.36 and the for_list feature - a simple speed comparison

List::Util::pairmap would be an existing solution very similar to the new feature. It also seems to run quite quickly (but I can't compare it to for_list since I don't have a new-enough perl).

use List::Util qw/ pairmap /; sub a_pairmap { my $i; pairmap { $i += $b } @vals; return $i; }

Good Day,
    Dean