RosettaCodeData/Task/Semordnilap/Perl/semordnilap.pl
2023-07-01 13:44:08 -04:00

7 lines
117 B
Raku

while (<>) {
chomp;
my $r = reverse;
$seen{$r}++ and $c++ < 5 and print "$_ $r\n" or $seen{$_}++;
}
print "$c\n"