in reply to optimized switch case
You could map the options into 1, 2, and 4, then add them. That will be insensitive to permutations, and provide a unique number for each combination. The selection can just use the number as an array index.
my @selections = ( 'Feeblizer', 'Cervical Vorbalizer', 'Cortical Vorbalizer', 'Corticocervical Extravorbalizer', 'Lumbar Vorbalizer', 'Cervicolumbar Extravorbalizer', 'Corticolumbar Extravorbalizer', 'Hypervorbalizer' ) $_ = $optstring # wherever that comes from my $options = m/A/ + 2 * m/B/ + 4 * m/C/; print $selections[$options];
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: optimized switch case
by screamingeagle (Curate) on Jan 04, 2002 at 00:25 UTC | |
by Zaxo (Archbishop) on Jan 04, 2002 at 03:51 UTC |