in reply to Find all string permutations

Does glob help?
use strict; use warnings; print "$_\n" for glob '{a,b}cd{f,g,h}'; __END__ acdf acdg acdh bcdf bcdg bcdh

Does output order matter?

If this does not suit your purposes, please give a couple more examples, showing exact output.