Masem has asked for the wisdom of the Perl Monks concerning the following question:

I know Perl has regex built in, but I am looking to see if there exists a module for doing state machines for pattern matching of a simplier nature (eg pretty much only supporting arbitraries like '0 or more', 'exactly 1'). I'm specifically looking to do this on a list as opposed to a string, in other words, trying to pattern match a list for a given series of elements. I know that I could 'cheat', and join the list into a string, and glorp off the regex engine to match with that, but I don't want to limit what I do to just string elements in the list at the moment (How other element types would be behave in pattern matching, I've yet to figure that out). CPAN has no obvious modules for this. Not that a state machine isn't hard to develop, but I'd rather not reinvent the wheel.
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: State machine module?
by jmcnamara (Monsignor) on Apr 17, 2001 at 11:52 UTC

    You could have a look at POE which describes itself as "event driven state machines". This may be a little too generalised for you requirements however. It is intended for larger scale state machine applications such as servers or event driven interfaces.

    Anyone who is interested in finding out about POE should look at this introduction.

    John.
    --
    <br