in reply to speed up split?

What are you trying to do?

What you aren't trying to do is make whitespace disappear, so you really don't need to get rid of newlines, although if you do, you should replace them with a space. Words tend to get smashed together otherwise.

I'm not sure what you want to do in the split(), but you probably don't want the /g modifier, and the /s modifier only matters if you use a . in the pattern (and the target string has a newline, but you just got rid of all of those).

You might do better with an HTML::Parser, but I'm not sure what you are doing.

--
brian d foy <bdfoy@cpan.org>