Counting DNA Nucleotides

Author: gerdr

http://rosalind.info/problems/dna/

Sample input

AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC

Sample output

20 12 17 21

Source code: dna-gerdr.pl

use v6;

my $default-input = "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC";

sub MAIN($input = $default-input) {
    "{<A C G T>.map({ +$input.comb(/$_/) })}".say;
}