in reply to Removing repeated words

I have to comment that your use of semicolons as pattern delimiters rather obfuscates this - I had to look twice before I saw exactly what was happening. Rewritten in a more traditional fashion, and using chomp rather than a mapped substitution to get rid of newlines, it immediately becomes a lot more legible:
while (<STDIN>){ chomp; print grep !$a{$_}++, split m/\s/; print "\n"; }
I don't see a whole lot of room for improvement there. There is not really any way to avoid the hash growing that large, as far as I can see, as you can't simply expire any of its items.

Makeshifts last the longest.