#!/usr/bin/env perl -l use strict; use warnings; my @x = glob '{CAT,CAC}TGG{GTT,GTC,GTA,GTG}{CCT,CCC,CCA,CCG}'; print "@x";