for ( 1..$strLen/2 ) { $copy .= substr $copy, 0, 1, ''; return wantarray ? ($_, substr $str, 0, $_) : $_ if $copy eq $str; }