No such thing as a small change | |
PerlMonks |
Re: Stopping bad input (harder than sanitizing)by jcb (Parson) |
on Mar 09, 2021 at 00:20 UTC ( [id://11129357]=note: print w/replies, xml ) | Need Help?? |
Your immediate problem is simple: sub search goes into an infinite loop if $search_pattern is undefined. Instead of a goto, simply return early, as in return unless defined $search_pattern; which will cause the Tk event loop to resume and the UI to wait for the user to try again.
In Section
Seekers of Perl Wisdom
|
|