#!/usr/bin/perl use strict; use warnings; use String::Combination; # Get all the combinations of bases which have a prescribed length. my $length=2; my @combinations=String::Combination::combination('atcg',$length); # Output the results. print "$_\n" for @combinations;