On Wed, Dec 11, 2002 at 06:53:20PM -0800, Randal L. Schwartz wrote:
> >>>>> "Rich" == Rich Morin <[EMAIL PROTECTED]> writes:
> 
> Rich> On occasion, I have found it useful to cobble up a "little language"
> Rich> that allows me to generate a list of items, using a wild-card or some
> Rich> other syntax, as:
> 
> Rich>    foo[0-9][0-9]  yields foo00, foo01, ...
> 
> Rich> I'm wondering whether Perl should have a similar capability, using REs.
> 
> Well, here's a cheap way:
> 
> my @list = glob ('foo{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}');
> 
> :-)

Cheap in terms of programmer effort. But it uses a lot of RAM in perl5.
Enough the the golfers get upset that some of the shortest solutions don't
work because they run out of swap. IIRC Hugo is lucky because his auction of
an improvement for perl 5.10 could easily have ended up with a bidder who
wanted multiway globs to work in much less RAM.

Nicholas Clark

Reply via email to