in reply to Combinations of multiple arrays

Algorithm::Loops's NestedLoops will do the trick:
use Algorithm::Loops qw( NestedLoops ); NestedLoops(\@list, sub { print(join(',', @_), "\n"); }, );
Or as an iterator:
use Algorithm::Loops qw( NestedLoops ); my $i = NestedLoops(\@list); while (my @set = $i->()) { print(join(',', @set), "\n"); }

Update: Fixed capitalization typo mentioned in reply.

Replies are listed 'Best First'.
Re^2: Combinations of multiple arrays
by Anonymous Monk on Sep 08, 2020 at 21:34 UTC
    Notice that there is a mistake in above code. It should be NestedLoops with a CAPITAL L.
    #/usr/bin/perl use Algorithm::Loops qw( NestedLoops ); my @list = ( [12,13,14,15], [6000,6001,6002,3150,3152], ['314456 C', '314484 D']); my $i = NestedLoops(\@list); while (my @set = $i->()) { print(join(',', @set), "\n"); }

      Thanks, fixed.