On 4/3/06, James Turnbull <[EMAIL PROTECTED]> wrote:

> The mainline program is monitoring something - every x seconds I wish to
> execute a subroutine from within the mainline and return to the mainline
> after executing the subroutine to continue the monitoring.

So, it sounds as if you want your mainline program to have an event
loop. One way might be like this:

  while (1) {
    &monitor_something();
    &call_sub_if_x_seconds_have_passed();
  }

But from the way you're writing about it, I wonder whether something
like POE might be the way to go. (It doesn't sound as if you need
fork/threads, so I won't mention those.)

    http://search.cpan.org/~rcaputo/POE-0.3301/lib/POE.pm

Also, CPAN has a section for "Server Daemon Utilities", although I'm
not sure whether this is what you're looking for:

    http://search.cpan.org/modlist/Server_Daemon_Utilities

I hope this gives you something to go on. Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to