in reply to Re^4: nested maps
in thread nested maps
I've got something on CPAN which does similar.
use strict; use warnings; use List::MapMulti; use Data::Dump 'pp'; my @a = 1..3; my @b = 4..6; my @c = 7..9; pp mapm { $_[0] . $_[1] . $_[2] } \@a, \@b, \@c;
It can also be used as an iterator:
use strict; use warnings; use List::MapMulti 'iterator_multi'; use feature 'say'; my @a = 1..3; my @b = 4..6; my @c = 7..9; my $iter = iterator_multi( \@a, \@b, \@c ); while ( my ( $a, $b, $c ) = $iter->() ) { say $a, $b, $c; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: nested maps
by raygun (Scribe) on Sep 22, 2020 at 21:53 UTC |