Help for this page
my @strs = qw/fooxx baryyyy bazzzzzzz/; s{ ( (.) \2+ ) \z }(substr($1, 0, length($1) / 2))ex, print ... foox baryy bazaaa
reverse =~ /\A((.)\2+)/ and substr($_, -(length($1) / 2)) = '' for @strs; ... foox baryy bazaaa