nextstate preps things between statements. It sets a pointer used to give warn and die messages a line number, clears the tainted-expression flag, resets the stack pointer, and frees any temporary variables generated by the previous statement.
scoping is done mostly by scope (for a scope containing a single statement), or enter* & leave (for a scope containing multiple statements).