in reply to enumeration, again...

I'm not sure I understand your purpose, but the same could be done something like this (untested, I'm not in a Perl-friendly zone :)
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 }

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^2: enumeration, again...
by tilly (Archbishop) on Mar 26, 2005 at 04:12 UTC
    I think you meant
    printf "bar=%s, biz=%s, foo=%s\n", split //, $_ for glob('{A,B,C}{1,2,3}{Y,Z}')
Re^2: enumeration, again...
by cazz (Pilgrim) on Mar 28, 2005 at 15:44 UTC
    While that works in the simple case, I didn't want to add ugly delimiters when my input grows to be more complex than simple words.
      So? Do a mapping. map all your words to four-character short names (take the next item from 'aaaa'..'zzzz', thanks to ++ this is easy).

      Then do your glob with glob. Then map all results through a "find 4 characters and replace them with the mapping" operations. Like magic!

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.


      update: If you think about this, it's a bit like how I came up with what was later called "the Schwartzian transform". When you can't solve a problem in one space, map it to another space, do the solution, then map it back. It's a common pattern of mine for solving things.