in reply to Re: search and replace regex return value
in thread search and replace regex return value

I can reproduce with Perl 5.24.1 and Tk 804.033 on Ubuntu. The output of the program after two button clicks is:

foobar foo foo foo

Which is strange, since ... =~ s/// is supposed to return the number of substitutions made, and clearly there's one being made here.

But as I said here, inspecting things with Devel::Peek shows that $CFG{target} appears to have PERL_MAGIC_uvar magic attached to it, so I guess that's causing this strange behavior (haven't yet investigated further).