my @list = glob({'A','B','C'}{'1','2','3'}{'Y','Z'}); foreach my $item (@list) { printf "bar=%s, biz=%s, foo=%s\n", split //, $item }