RosettaCodeData/Task/Semordnilap/Perl/semordnilap.pl
2025-08-11 18:05:26 -07:00

7 lines
120 B
Raku

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