http://qs321.pair.com?node_id=1187563

vrk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I was reading the manual entry for glob the other day, and discovered a feature I hadn't used before: brace-only "wildcard" expressions can be used to generate strings with no globbing behaviour (that is, no matching against filenames in the current directory). The manual gives one example:

@many = glob "{apple,tomato,cherry}={green,yellow,red}";

It's closely related to the Perl 6 "X" operator, but limited to string elements only.

It's fun to try different ways to generate all pairs, triples or tuples of some length. For example, the following prints the coordinates of the standard chessboard:

perl -E '$" = ","; my @pos = 'a'..'h'; say for <{@pos}{@{[ 1..@pos ]}} +>'

Other than toy examples, have you used this kind of a glob in production code? What kind of non-trivial use cases can you suggest?