Does anyone know why the system hangs with no reaction if I use

sleep 10;

in a Win_OnTimer subroutine?

It sleeps for 10 seconds, and I cannot even close the program in those 10
seconds.

Then the program works fine again until the timer runs again that function.

The system hangs because it's sleeping:) Basically, your app isn't processing any events, therefore giving the impression that it's hung.

I want to use sleep() just to test how the program works if it does
something for a few seconds, like downloading something from a web site.

If I want to create a program that downloads periodically something and save
into afile, then periodically gets the data from that file and displays it,
is it absolutely necessary to use fork() or threads? (and if yes, which of
them do you recommend?)

If you want to avoid the impression that your app has hung - yes. Don't use fork, use threads. Use the latest version of Win32-GUI (it's thread safe) and use the latest version of Perl you can - 5.8.7 and beyond.

Cheers,

jez.



Reply via email to