perl has no way to look at the system time. You have to get a perl script running before it can do anything. Conventional practice is:
Code:
while(1){
check time here
if (its time) {
do your thing
}
else {
sleep(n);
next;
}
}
but this script will never end unless you put in some type of condition to break it out of the "while" loop or you shut it down. But if the system is setup to monitor how long scripts run it might be killed off by the system.
This may work, you would need to get the class ParseCron.
Code:
use FB::ParseCron;
sub checkCron
{
my ($function,$client) = @_;
my %hash = %{$function};
my $value = $hash{CRON}[0];
my $c;
if ($value)
{
$c = FB::ParseCron->new($value);
}
if ($c->now)
{
return 0;
}
return 1;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.