http://www.perlmonks.org?node_id=199483


in reply to Removing repeated words

while (<stdin>){ print map((s/$/ / && $_), grep(!$a{$_}++, split m/\s+/,$_)); print "\n"; }
Update: Fri Sep 20 10:25:01 2002
Whoops, forgot the \s+.. And switch the regex delims by request.