in reply to Event loop with rules handling

Your requirements seem to fit the pattern of "Discrete Finite Automata" - please look at the DFA::Simple module.

    Earth first! (We'll rob the other planets later)