procmail
[Top] [All Lists]

Re: Best way to nest rcfiles ...

1999-11-27 10:14:59
Rejo asked,

| This is what i have now in my rc file:
| 
|   :0
|   * check
|   {
|         :0
|         * additional_check
|         action
| 
|           :0E
|           different_action
|   }

OK.

| The question is, what is the best way to write this down? As above, or
| would this be better?
| 
|   :0
|   * check
|   * additional_check
|   action
| 
|   :0
|   * check
|   * ! additional_check
|   different_action

That is not so good, as it requires retesting for the conditions.

| Or even
| 
|   :0
|   * check
|   * additional_check
|   action
| 
|   :0E
|   * check
|   different_action

That has the same problem, as again it retests a condition whose result
could be more easily remembered.

| What's the best way? The last one is no good i guess, but i can't see a
| major difference between the first and the second...

The first is definitely the best, as it solves the entirety with at most two
tests.

Let's consider them:

                                    number of conditions tested under ...
                                    method 1       method 2     method 3

if check fails                      1              2            2
if check passes but
 additional_check fails             2              4            3
if check and additional_check
 both pass                          2              2            2