while ( my $token = $stream->get_token ) { if( ( $token->is_comment and $token->as_is eq '' ) .. ( $token->is_comment and $token->as_is eq '' ) ) { print $token->as_is if $token->is_text; } }