in reply to Multiple Permutation handling
Here's a glob option:
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}";
Partial output:
SKU1TSBLU SKU1TSGRN SKU1TSWHT SKU1TSBLK SKU1TMBLU SKU1TMGRN ... SKU3HXLWHT SKU3HXLBLK SKU3H2XBLU SKU3H2XGRN SKU3H2XWHT SKU3H2XBLK
Update:Removed unnecessary dashes in the string and the substitution. Thanks, kcott.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple Permutation handling
by rjt (Curate) on Mar 01, 2013 at 21:35 UTC | |
|
Re^2: Multiple Permutation handling
by Laurent_R (Canon) on Mar 02, 2013 at 22:20 UTC | |
by choroba (Cardinal) on Mar 02, 2013 at 22:24 UTC | |
by Laurent_R (Canon) on Mar 02, 2013 at 23:46 UTC | |
|
Re^2: Multiple Permutation handling
by kcott (Archbishop) on Mar 03, 2013 at 12:32 UTC | |
by Kenosis (Priest) on Mar 03, 2013 at 23:13 UTC |