#!/usr/bin/perl use strict; use warnings; my @combos = glob "{a,b,c}{1,2}"; print "@combos\n"; __END__ Prints: a1 a2 b1 b2 c1 c2