gives:#!/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";
$ perl tmp.pl non-unique words: is, this, $
In reply to Re: Finding duplicate words in a paragraph
by ciderpunx
in thread Finding duplicate words in a paragraph
by perladdict
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |