And as is periodically mentioned, the conventional wisdom on using Switch in production is "you shouldn't" (straight from the horse's mouth, Categorized Damian Modules).
Update: And as for suggestions, since you've got a predicate rather than a simple key you could still use a dispatch table, it's just not as direct. I haven't looked at your sample data directly, but often you can find some mathematical function which converts a value to a "bin" number (as a really trivial example, something like int( $value / 10 ) to map a value 0..100 into bins 0..10). You then use that function as the key in your dispatch table instead.
In reply to Re: Efficiency & Maintenance: if/elsif or Other Dispatch Method
by Fletch
in thread Efficiency & Maintenance: if/elsif or Other Dispatch Method
by madbombX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |