List::EachCons - Apply code to each array element and a block of successors
use List::EachCons; my @list = qw/a b c d/; each_cons 3, @list, sub { say "@_"; }; # a b c # b c d
This module provides the function each_cons.
each_cons
If $array has at least $size elements then this function calls $code for each element in $array with $size consecutive elements from the array as argument in the order of elements in the array. Returns a list of return values from invoking the code reference.
$array
$size
$code
each_cons by default.
Copyright (c) 2014 Bjoern Hoehrmann <bjoern@hoehrmann.de>. This module is licensed under the same terms as Perl itself.
To install List::EachCons, copy and paste the appropriate command in to your terminal.
cpanm
cpanm List::EachCons
CPAN shell
perl -MCPAN -e shell install List::EachCons
For more information on module installation, please visit the detailed CPAN module installation guide.