Perl: the Markov chain saw | |
PerlMonks |
Re: Read Between the Linesby sundialsvc4 (Abbot) |
on Jul 05, 2013 at 01:54 UTC ( [id://1042559]=note: print w/replies, xml ) | Need Help?? |
A more generalized way to handle such requirements is with a Finite-State Machine (FSM) approach. The algorithms consider, not only the current line of input, but the $state that the FSM is “in” at the time, where the current value of $state is determined by recent history of lines seen. It is probably overkill for a requirement as trivial as this one seems to be,.
In Section
Seekers of Perl Wisdom
|
|