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


in reply to Re^2: Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's -- permutations
in thread Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's

It returns far more results than needed, as they are repeated, because for permutations, zero at position 0 is different to zero at position 1.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re^3: Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's -- permutations
  • Download Code