lex

Returns an anonymous subroutine that returns a token type/content pair on each invocation, and ('', undef) when there's no more.