main dots / scripts / Scripts / perl / dupewords.pl
xxwhirlpool  ·  2026-07-22
 1#!/usr/bin/env perl
 2
 3use 5.38.2;
 4use strict;
 5use warnings;
 6
 7use Term::ANSIColor qw(:constants);
 8
 9sub readfile {
10	print("paste writing:\n(submit text with ctrl+d)\n\n");
11	my @writing = <STDIN>;
12	print("\n\n"); # idk how to have it not print STDIN so linebreaks it is
13
14	foreach my $line (@writing) {
15		if($line =~ /\b([A-Za-z]+) \1\b/) {
16			print("found repeat: ");
17			print(RED, "$&" , RESET, "\n");
18		}
19	}
20}
21
22readfile