Hello,
Just create a daemon and then put an infinite loop.
Call the subroutines with a sleep set accordingly, so
that the subroutine will run only at specified
interval.
Below is an sample code you can use.
Program will run as a daemon and you can kill it using
kill -9 <pids of file.pl>
Regards
Nishanth
#!/usr/bin/perl
use POSIX qw(setsid);
chdir '/';
umask 0;
open STDIN, '/dev/null';
#open STDOUT, '>/dev/null';
open STDERR, '>/dev/null';
defined(my $pid = fork);
setsid;
while(1) {
#Sleep for the amount of time it should not respond.
sleep(5);
&subroutine;
}
sub subroutine{
print "Test\n";
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>