You guys just don't get it:
while ($tmppol=~ s/(\S+)//) {
On a very long string with a few thousand "words" this change the length of the string a couple of thousand times. These are the kind of things that actually make a difference.
Erm - I realise this is reaching irrelevancy, but part of the point is the "non-standard" code; "\\s+" as a split operator is "not perl". A future maintainer will think there was some tricky reason for doing this rather than the standard split(/\s+/, ...) or split(' ', ...) And the thing to remember is that Perl is a language of optimisations; it's a scripting language not a system programming language. When you can use a perl optimisation without entering an obfuscation contest, it is always worth using them. That said, I personally find it's just easier not to argue with the nano-second saving perlmeisers :-); perlers are a very religious bunch, with a tendency to opt out of the laziness principle when it comes to discussing SEC (someone elses code). Oliver