Hi, On 19.01.19 15:16, James E Keenan via RT wrote: > Shouldn't this be "... is reporting 2 instead of the expected 3"? > (That's what your post-END text is showing.) Sorry, I should have said the attached test isn't *exactly* the same - (?{$^N}) vs. (?{"x$^N"}) means that in the oneliner, it's length("c")==1 vs. length("c")==2, and in the attached test it's length("xC")==2 vs length("xC")==3. Regards, -- Hauke D On 19.01.19 15:16, James E Keenan via RT wrote: > On Sat, 19 Jan 2019 13:45:44 GMT, haukex@zero-g.net wrote: >> Hi everyone, >> >> This oneliner fails, when it most likely shouldn't: >> >> perl -e 'while( "\N{U+E4}bc" =~ /(..?)(?{$^N})/g ) >> { length($^R)==length("$^R") or die }' >> >> A slightly longer test program (attached) shows that on the second >> iteration, length($^R) is reporting 2 instead of the expected 1. > > Shouldn't this be "... is reporting 2 instead of the expected 3"? (That's what your post-END text is showing.) > >> It seems to have something to do with UTF8 strings, since it works fine on >> non-UTF8 strings. >> >> Tested on several versions of Perl on Linux and Windows (down to 5.8.9). >> >> Regards, >> -- Hauke D > >Thread Previous | Thread Next