in reply to Really Long if/elsif/else blocks
I wanted tight control over the order of tests
use an array or arrayref to store your list of tests.
Many of my tests involve function calls, not just eq tests
a dispatcher can use a coderef (anonymous sub) to determine if the dispatch is to be used.
Intermediate results from earlier tests are saved in 'my' variables and used by later tests.
use a state variable of some sort that you pass to each dispatch selector. This would then hold your intermediate values.
Then again, I tend to oversimplify things.
--MidLifeXis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Really Long if/elsif/else blocks
by throop (Chaplain) on May 30, 2008 at 19:32 UTC | |
by MidLifeXis (Monsignor) on May 30, 2008 at 20:19 UTC | |
by perreal (Monk) on May 30, 2008 at 22:10 UTC |