in reply to Re^2: Avoiding if/else knots
in thread Avoiding if/else knots
To quote myself, "The trouble with dispatch tables in Perl is that the conditions need to be exact keys". I didn't say that creating a range was hard, I said "you need to create keys for each of those integers".
In other words, there is no short-cut to make that a single key and anything that can't be done as a straight lookup (requires logic) doesn't work. That is, it doesn't work without additional if/elsif/else knots to determine the correct key to dispatch.Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Avoiding if/else knots
by xdg (Monsignor) on Aug 18, 2006 at 14:28 UTC | |
by Limbic~Region (Chancellor) on Aug 18, 2006 at 15:17 UTC |