in reply to all permutations of given lenght

O=C(O)C(N)CCC/N=C(\N)N, O=C(N)C[C@H](N)C(=O)O, O=C(O)[C@@H](N)Cc1cncn1
That's SMILES! What are you actually trying to do?

Replies are listed 'Best First'.
Re^2: all permutations of given lenght
by cataclismic_user (Novice) on Aug 11, 2020 at 08:08 UTC
    Indeed! I am trying to generate an exhaustive list of SMILES codes, including their repetitions. I have tried
    use strict; use warnings; use Algorithm::Combinatorics qw(permutations); my $strings = [qw(A B C)]; my $iter = permutations($strings, 3); while (my $c = $iter->next) { print "@$c\n"; }

    The problem is that it does not generate things like AAA, BBB, CCC [A, B, C would be the corresponding SMILEs).

      I am trying to generate an exhaustive list of SMILES codes, including their repetitions.
      permutations are reorderings, i.e. samples without replacement. You seem to want all possible samples with replacement, i.e. variations_with_repetition.