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

Re^2: Multiple Permutation handling

by kcott (Abbot)
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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-10-22 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls