in reply to permutations of all number in a given set

Both DamnDirtyApe and Anonymous Monk gave clever, general answers. Here is a simple approach:
my @AoA = ([0,1] ,[8,9,10,11]); foreach my $arr (@AoA) { foreach my $i (0..@$arr-1) { foreach my $j (0..@$arr-1) { next if $i == $j; print "$arr->[$i],$arr->[$j]\n"; } } }

-Mark