When you need two (or more) concurrent loops like this, you can use threads. However, in this case you can just combine them into a single loop, as follows (untested):
my $time_slept = 0; while (1) { ... $time_slept += sleep $config{Database}->{Sleep}; if ($time_slept >= 7200) { DB_Backup(); $time_slept = 0; } }
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Concurrent Whiles?
by Athanasius
in thread Concurrent Whiles?
by dcthehole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |