in reply to Using interact()
Hum, not sure I understood what you are looking for, but a dispatch table (i.e. generally a hash in which you store code references to subroutines to be executed for the various possible inputs) might something useful for you.