Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Multiple Permutation handling

by kcott (Canon)
on Mar 03, 2013 at 12:32 UTC ( #1021498=note: print w/replies, xml ) Need Help??

in reply to Re: Multiple Permutation handling
in thread Multiple Permutation handling

I was wondering why you added hyphens to the glob string and then added a map function to remove them. It seems like a lot of additional processing that has no real value: perhaps I'm missing something.

This code produces the same output that you posted:

use strict; use warnings; my $sku = join ',', qw/SKU1 SKU2 SKU3/; my $tslh = join ',', qw/T S L H/; my $size = join ',', qw/S M L XL 2X /; my $color = join ',', qw/BLU GRN WHT BLK/; print "$_\n" for glob "{$sku}{$tslh}{$size}{$color}";

-- Ken

Replies are listed 'Best First'.
Re^3: Multiple Permutation handling
by Kenosis (Priest) on Mar 03, 2013 at 23:13 UTC

    ...perhaps I'm missing something.

    No, you haven't missed anything. I did unnecessarily add elements and processes. Good catch! ++

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021498]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2016-10-24 16:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (309 votes). Check out past polls.