in reply to Really Long if/elsif/else blocks

You might look into the given/when statement now available in 5.10. That is not a substitute for refactoring, but might make the existing logic somewhat cleaner, as a first step.