Simon Willison’s Weblog

Perl state machine to scrape HTML. Great working example of a state machine in action.