Class::StateMachine allows to define methods that are dispatched depending on an internal state property via the OnState attribute. WWW: http://search.cpan.org/dist/Class-StateMachine/