http://qs1969.pair.com?node_id=487168


in reply to All Combinations of three arrays.

Simple use of Algorithm::Loops, but so simple I didn't test it. (:

#!/usr/bin/perl -w use strict; use Algorithm::Loops qw( NestedLoops MapCarE ); my @data = ( [ [1, "Darth Vader"], [3, "Luke Skywalker"], [5, "Obi Wan Kenobi"], ],[ [0, "Lighsabre "], [5, "Blaster"], [9, "Rocket launcher"], ],[ [10, "Dagobah"], [14, "Kashyyyk"], ], ); my @joined= NestedLoops( \@data, sub { my( $dig, $txt )= MapCarE { [ @_ ] } @_; [ join('',@$dig), join(', ',@$txt) ]; }, ); for( @joined ) { print join("\t",@$_), $/; }

- tye