my $base = join ",", qw/A T C G/; my $L = 4; my $string = "{$base}" x $L; my @combinations = glob $string; print join ":", @combinations;