Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 having an uproarious good time at the Monastery: (5)
As of 2015-07-07 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls