Help for this page
for ( 0 .. 2**$n-1 ) { my @combo = map { $_ + 1 } split //, sprintf("%0*b", $n, $_); say "@combo"; }
use Algorithm::Loops qw( NestedLoops ); ... while ( my @combo = $iter->() ) { say "@combo"; }