Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

Comment on Re^2: Multiple Permutation handling
Select or Download Code
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 making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-05-28 02:58 GMT
Find Nodes?
    Voting Booth?