The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 0.10 - 2004-12-17

  • Moved state-specific methods to new FSA::State class. This is a pretty significant change and can introduce backwards compatability issues, so the version has been bumped up to 0.10.
  • FSA::State objects are now passed to state actions, rather than the FSA::Rules object. Call their machine() method to get the FSA::Rules object.
  • Switch actions are now passed two arguments: The current FSA::State object and the FSA::State object for the new state.
  • Added notes() method for storing arbitrary notes in the FSA::Rules object.
  • Added states() method to return one or more of the state objects in a machine.
  • Moved the "message" and "result" methods to the state class. The "set_" forms are gone now, since you don't need to specify a state when you have a state. Added last_message() and last_result() methods to FSA::Rules to get the most recent messages and results from the states.
  • Added convenience methods prev_state(), notes(), and done() to the state class to reach back into the FSA::Rules object.
  • The start() method will now throw an exception if the machine is already running. Call reset() before calling start on a running machine.
  • Added "strict" attribute to prevent rules from short-circuiting and cause an exception to be thrown if more than one rule returns a true value during a call to try_switch(). Suggested by Curtis Poe.
  • Added optional parameter hash reference as first argument to new(). It can force the machine to be started before being returned, or can set the "done" or "strict" attributes.

Modules

Build simple rules-based state machines in Perl

Provides

in lib/FSA/Rules.pm