in reply to Cutting repetition in POE coding

It sounds like you're reinventing POE::NFA, which dispatches events to different handlers depending on a session-scoped state.

It's hard to pinpoint a proper solution since you're asking about a specific technology rather than describing the problem to be solved.