in reply to Finding duplicate words in a paragraph

howzabout:
#!/usr/bin/perl -w use strict; my @para = qw|this is my paragraph. this is not all that interesting. +hey ho|; my %hash = (); print "non-unique words: \n"; ## the interesting bit ## map {$hash{$_}++} @para; for (keys %hash){print "$_ " if($hash{$_}>1)}; ######################### print "\n";
gives:
$ perl tmp.pl non-unique words: is, this, $