in reply to Looking for a state machine

If the sequence of steps can be defined from the top down with some branches, you might also look at Parse::RecDescent, although for a large file, speed might be a factor.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.