##
#!/usr/bin/perl
#
use strict;
use warnings;
my $inputFile = q{spw888564.txt};
open my $inputFH, q{<}, $inputFile
or die qq{open: < $inputFile: $!\n};
while ( <$inputFH> )
{
next unless m{(\w+).*\b\1\b};
print qq{Found '$1' repeated in: $_};
}
close $inputFH
or die qq{close: < $inputFile: $!\n};
####
Found 'and' repeated in: fish and chips and mushy peas
Found 'boom' repeated in: boom bang boom