#!/usr/bin/perl use 5.016; use warnings; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 123412312341231234123123412312341231234123 oxoxoxoxoxoxoxoxxoxoxoxoxoxoxoxoxx )){ say $_, " -> ", /^(.+?)\1*$/; }
Standard input is empty
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -> a 123412312341231234123123412312341231234123 -> 1234123 oxoxoxoxoxoxoxoxxoxoxoxoxoxoxoxoxx -> oxoxoxoxoxoxoxoxx