in reply to Re^2: Really Long if/elsif/else blocks
in thread Really Long if/elsif/else blocks

Good catch. The new sub should be a function then that would return a 1 by default, but a 0 if none of the conditions were met (i.e. the final else would set it).

Then the conditional in the original code would be

elsif($checkPrefix and CheckPrefaces() ) { } # do *nothing*; processing was handled in CheckPrefaces

It looks a trifle odd, but I still prefer factoring out a related block of code. Everything works fine in the original body of code, but someday it will have to be modified, and the supporting programmers eyes will glaze over...