Aug 21, 2011, 2:20 AM
Post #1 of 3
Perl waiting for a function to finish
I have wrote a TK (GUI) program in perl, and in one of the fields I have made a filter line which filters a listbox according to the input given.
I have binded the filter entry to a KeyPress, so everytime I enter a character it filters the listbox.
There is a problem I am having, since everytime I enter a character it enters a function which filters the listbox, it takes time and when I enter characters fast enough,
the program doesn't finish the function and the function runs parallelly so it doesn't do the filtration I want, and if I enter characters slow enough it works just fine.
Is there a way to make the second, enterance to the function wait for the first call to finish before starting to execute parallelly?