
use strict 'vars';
undef $/;
my $file = <>;

while ($file =~ /\b(\w+)   # First occurrence of a word
                 \W+       # Intervening space or punctuation
                 \1\b      # Second occurrence
                /gx) {
  print "Found repeated word `$1'.\n";
}





