|There's more than one way to do things|
I am working on a Perl::TK project and I am trying to figure out the theory behind making a timed process run off.
I connect to a database and pull data from it and display it on the screen. I would like to have the program check for updates every 30 seconds or so and if need be, update the data.
I don't really have a good grasp as to how to efficiently force the program to check every x seconds?
I tried to do a check time statement in the main body of the script like so:
and have the program set the time initially when it first starts the section. But this did not work, I did some testing and even though I placed the if statement in the main body (just above the mainloop) it did not get called, which makes me believe that the system does not keep cycling (ie, like Java) but instead just sits and waits?
so my question is can someone help me with the theory of how to make this work? I assume I am missing something? I have been working on this for the last day and I am stumped :(
Thank you for any help,