in reply to Re: if/unless and chaining
in thread if/unless and chaining
the middle line is the same asunless( state equals A ) { Take action1 } elsunless( state equals B ) { Take action2 } else { Take action3 }
I agree, don't do that. But not every chain of if/elses is a simple switch statement. I can be testing a number of variables or aspects of the total state, making successively tighter constraints. Think of an && chain with side-effects on each test.elsif (state != B) ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: if/unless and chaining
by Anonymous Monk on Nov 06, 2002 at 20:23 UTC |