http://www.perlmonks.org?node_id=469548


in reply to passing qr//'d regexp via Perl/Tk Entry widget

Greetings,
I feel this has more to do with the binding operator  =~ than it does with your entry widgets get method. Here is the perlop snippet that makes me think so. clipped for clarity
...``=~'' binds a scalar expression to a pattern match. ... (If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run time.

So if you simply type in "foo" you get a match since the  =~ seems to be treating it as /foo/ by default.
One workaround might be to strip off the "qr/" and trailing "/" prior to the match.
Here is an example of the behavior
#!/usr/bin/perl -w use strict; my $string = "foobarbaz"; my $exp = "foo"; if($string =~ $exp){ print "without /'s works fine"; }elsif($string =~ /$exp/){ print "with /'s is needed"; }else{ print "WTF!??"; }

This outputs
without /'s works fine
-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo