You may want to search on ATN (augmented trans networks) -- as they are more useful than RTN in many cases (and at a low level an extension of them). A perl module for implementing ATN/RTN is
DFA::Simple. If you are wondering about the differences between how ATN and RTN state machines are constructed and used a good article is:
Here (offsite:gatech.edu).