in reply to perl/tk script freezes

I agree with pc88mixer. You need to run the snmp code in a separate thread, or thru some IPC module( a fork). The reason do_one_event won't work, is that the snmp stuff hogs the execution pointer and won't let Tk get any control. There are alot of examples here and on groups.google for "Tk threads" and "Tk::IPC".

Actually it look very easy to convert to threads.... just make your StrtScan sub a thread, create it before any Tk code is called, and remove any Tk code from it. Set up some shared variables, and a Tk::timer to read them from the thread, for inter-thread communication.

I'm not familiar with Net::SNMP, but there MAY be a mechanism to get your script to work, like setting a timeout and running do_one_loop at each timeout, or possible Net::SNMP has a hook to run external code, in which you can do_one_loop.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum