while ( $token=$p->get_token() ) { .... } ... print FILE $token->as_is; close FILE;