|Perl: the Markov chain saw|
passing qr//'d regexp via Perl/Tk Entry widgetby young_stu (Beadle)
|on Jun 23, 2005 at 21:17 UTC||Need Help??|
young_stu has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on a Perl/Tk gui that I hope will allow a user to type a regexp into an entry widget for matching against some text. I'd like to to be true that the user, if he or she pleases, may supply a qr//'d regexp. So far, what seems to me to be the obvious way to do it has failed.
The following code demonstrates the failure...
To see the failure, run the script and do the following:
(1)press the "Match using stored Regexp" button, and watch your STDOUT line.
into the entry widget, press the "Match using what you typed!" button, and watch STDOUT.
Surprisingly (perhaps only to a neophyte like me) it "works" if in step (2) above, you instead type
into the entry widget.
What's going on here? My first guess is that there's something happening with the entry widget's "get" method